home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSAM.EXE
/
BDCOPT.PRG
< prev
next >
Wrap
Text File
|
1993-05-11
|
96KB
|
3,043 lines
*-- DBW - Dialog Box Workshop - BDCOPT.PRG
PROCEDURE BDCOPT
*----------------------------------------------------------------------------
* NAME
* DESCRIPTION
*----------------------------------------------------------------------------
PRIVATE cAlias, cWindow, lTalk, lSafety, cDialog, cHelpFile, cStartLib
IF SET( "TALK" ) = "ON"
SET TALK OFF
lTalk = .T.
ELSE
lTalk = .F.
ENDIF
lSafety = SET( "SAFETY" ) = "ON"
SET SAFETY OFF
cWindow = WINDOW()
cAlias = ALIAS()
*----------------------------------
*-- Setup the help system variables
*----------------------------------
lError = .F.
cHelpFile = "BDCDRIVE"
cDialog = "BDCOPT"
cDBBLib = "DBBLIB"
*----------------------------------------------
*-- Setup the link to the DBB Procedure Library
*----------------------------------------------
ON ERROR lError = .T.
cStartLib = SET( "PROCEDURE" )
SET PROCEDURE TO ( cDBBLib )
IF lError
lError = .F.
SET PROCEDURE TO HOME() + cDBBLib
IF lError
*-- Display the error message in a windowed box
PRIVATE lc_anykey, lc_msg, lc_msglen, lc_win, ln_press, ln_width, ll_trap,;
ll_escape
lc_anykey = [Press any key to continue...]
ln_press = LEN( lc_anykey )
lc_msg = [Could not locate procedure file: ] + cDBBLib
ln_msglen = LEN( lc_msg )
ln_width = 0
ll_escape = SET("ESCAPE") = "ON"
SET ESCAPE OFF
*-- Determine the width needed for the window:
IF ln_msglen <= ln_press
ln_width = ln_press
ELSE
*-- Make sure the message fits in the window:
IF ln_msglen > 76
lc_msg = LEFT( lc_msg, 76 )
ln_msglen = 76
ENDIF
ln_width = ln_msglen
ENDIF
DEFINE WINDOW _err_box FROM 9, ((76 - ln_width) + .5) / 2 ;
TO 15, (ln_width + 83) / 2 DOUBLE
ln_width = ( ln_width + 2 )
*-- Display the message and prompt to the window and wait for a key press
ACTIVATE WINDOW _err_box
? lc_msg AT ( ln_width - ln_msglen ) / 2
?
? lc_anykey AT ( ln_width - ln_press ) / 2
SET CONSOLE OFF
WAIT
SET CONSOLE ON
*-- Clean up the window display and reactivate the previous window
RELEASE WINDOW _err_box
IF ll_escape
SET ESCAPE ON
ELSE
SET ESCAPE OFF
ENDIF
ENDIF
ENDIF
ON ERROR
*---------------------------------
*-- Run the actual dialog box code
*---------------------------------
IF .NOT. lError
DO Dialog
ENDIF
*----------------------------------
*-- Restore the startup environment
*----------------------------------
IF .NOT. ISBLANK( cStartLib )
SET PROCEDURE TO ( cStartLib )
ENDIF
IF .NOT. ISBLANK( cAlias ) .AND. SELECT( cAlias ) > 0
SELECT ( cAlias )
ENDIF
IF lSafety
SET SAFETY ON
ENDIF
IF lTalk
SET TALK ON
ENDIF
IF .NOT. ISBLANK( cWindow )
ACTIVATE WINDOW &cWindow
ENDIF
RETURN
*-- EOP: BDCOPT
PROCEDURE Dialog
*----------------------------------------------------------------------------
* NAME
* Dialog -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
*---------------------------------------
*-- Temporary for now, message varaibles
*---------------------------------------
DLN_OK = -500
DLN_CANCEL = -501
DLN_HELP = -502
WM_PAINT = 15 && Notification to repaint client area
WM_CLOSE = 16 && Note that user selected close button
WM_DRAWITEM = 43 && Notification to the owner of an
BN_CLICKED = 0
BN_PAINT = 1
BN_HILITE = 2
BN_UNHILITE = 3
BN_DISABLE = 4
BN_DEFAULT = 6
BN_PRESSED = 7
BN_COLOR = 8
SE_SHADOW = -100
EN_SETFOCU = 1
EN_KILLFOC = 2
CB_SELECTS = 13
CB_SHOWDRO = 15
CB_HIDELST = 25
CBN_SELCHAN = 1
CBN_DBLCLK = 2
CBN_SETFOCU = 3
CBN_KILLFOC = 4
CBN_EDITCHA = 5
CBN_EDITUPD = 6
CBN_DROPDOW = 7
CBN_INLIST = 8
LBN_SELCHA = 1
LBN_DBLCLK = 2
LBN_SELCAN = 3
LBN_SETFOC = 4
LBN_KILLFO = 5
KB_TAB = 9
KB_ENTER = 13
KB_SPACE = 32
KB_SHIFTTAB = -400
KB_UPARROW = 5
KB_DOWNARROW = 24
KB_LEFTARROW = 19
KB_RTARROW = 4
KB_F1 = 28
KB_ESC = 27
KB_MOUSE = -100
KB_CTRLW = 23
*--------------------
*-- Working variables
*--------------------
PRIVATE nCurrent, nCurrGrp, lButtAct, nMRow, nMCol, nMsEvent, nDlgDef, nAccel
PRIVATE n1stGrp, nCancelBt
nCurrent = 0 && Current dialog object id
nCurrGrp = 0 && Current group id for object id
lButtAct = .F. && Dialog has a button active
nMRow = -1
nMCol = -1
nMsEvent = 0
nDlgDef = 0
nAccel = 0
n1stGrp = 0
nCancelBt = 0 && Id for cancel button
PRIVATE nDefButt, nMess
nDefButt = 0 && Number of object with default button
nMess = 0
PRIVATE cOldFClr, cOldBClr, cOldHClr, cOldMClr, cOldNClr, cOldTClr
cOldFClr = _ColorChk( "F" )
cOldBClr = _ColorChk( "B" )
cOldHClr = _ColorChk( "H" )
cOldMClr = _ColorChk( "M" )
cOldNClr = _ColorChk( "N" )
cOldTClr = _ColorChk( "T" )
SET COLOR OF FIELDS TO w+/b
SET COLOR OF BOX TO n/gb
SET COLOR OF HIGH TO w+/g
SET COLOR OF MESS TO n/gb
SET COLOR OF TITLE TO n/gb
*------------------------
*-- Close Icon for window
*------------------------
PRIVATE nRowCls, nOrigRow, nOrigCol, nXoffset, nYOffset, nCol, ;
nHigh, nWidth, nLColCls, nRColCls, nRWinCol, cField, cClass, nScreen
cField = ""
cClass = ""
nRowCls = 1
nOrigRow = 1
nOrigCol = 8
nXOffset = 0
nYOffset = 0
nCol = 8
nHigh = 19
nWidth = 63
nLColCls = 10
nRColCls = 12
nRWinCol = 70
nScreen = IIF( "50" $ SET("DISPLAY"), 49, ;
IIF( "43" $ SET("DISPLAY"), 42, 24 ) )
IF SET( "STATUS" ) = "ON"
nScreen = nScreen - 3
ENDIF
PRIVATE nClkBox, nClkObj, aClkBox, aClkObj, aObjPoint
*--------------------------------------------------
*-- Get the number of clickable boxes in the dialog
*--------------------------------------------------
nClkBox = 0
*--------------------------------------------------
*-- Get the number of clickable items in the dialog
*--------------------------------------------------
nClkObj = 14
DECLARE aClkObj[ 14 , 13 ]
aClkObj[ 1 , 1 ] = 4 && Row
aClkObj[ 1 , 2 ] = 14 && Col
aClkObj[ 1 , 3 ] = 30 && Decimals
aClkObj[ 1 , 4 ] = 9 && CurrentId
aClkObj[ 1 , 5 ] = 6 && GroupId
aClkObj[ 1 , 6 ] = 11 && NextId
aClkObj[ 1 , 7 ] = 51 && PrevId
aClkObj[ 1 , 8 ] = " " && PickKey
aClkObj[ 1 , 9 ] = 9 && Previous item in group
aClkObj[ 1 ,10 ] = 9 && Next item in group
aClkObj[ 1 ,11 ] = "CD_FILE_1" && XXXXXXXXXXXXX [v]
aClkObj[ 1 ,12 ] = []
aClkObj[ 1 ,13 ] = []
aClkObj[ 2 , 1 ] = 4 && Row
aClkObj[ 2 , 2 ] = 38 && Col
aClkObj[ 2 , 3 ] = 55 && Decimals
aClkObj[ 2 , 4 ] = 11 && CurrentId
aClkObj[ 2 , 5 ] = 11 && GroupId
aClkObj[ 2 , 6 ] = 20 && NextId
aClkObj[ 2 , 7 ] = 9 && PrevId
aClkObj[ 2 , 8 ] = "d" && PickKey
aClkObj[ 2 , 9 ] = 11 && Previous item in group
aClkObj[ 2 ,10 ] = 11 && Next item in group
aClkObj[ 2 ,11 ] = "BT_EDITCF" && E~dit config file
aClkObj[ 2 ,12 ] = []
aClkObj[ 2 ,13 ] = []
aClkObj[ 3 , 1 ] = 7 && Row
aClkObj[ 3 , 2 ] = 14 && Col
aClkObj[ 3 , 3 ] = 27 && Decimals
aClkObj[ 3 , 4 ] = 20 && CurrentId
aClkObj[ 3 , 5 ] = 16 && GroupId
aClkObj[ 3 , 6 ] = 24 && NextId
aClkObj[ 3 , 7 ] = 11 && PrevId
aClkObj[ 3 , 8 ] = "C" && PickKey
aClkObj[ 3 , 9 ] = 24 && Previous item in group
aClkObj[ 3 ,10 ] = 24 && Next item in group
aClkObj[ 3 ,11 ] = "RB_MODE_1" && ( ) ~Compact
aClkObj[ 3 ,12 ] = []
aClkObj[ 3 ,13 ] = []
aClkObj[ 4 , 1 ] = 8 && Row
aClkObj[ 4 , 2 ] = 14 && Col
aClkObj[ 4 , 3 ] = 27 && Decimals
aClkObj[ 4 , 4 ] = 24 && CurrentId
aClkObj[ 4 , 5 ] = 16 && GroupId
aClkObj[ 4 , 6 ] = 21 && NextId
aClkObj[ 4 , 7 ] = 20 && PrevId
aClkObj[ 4 , 8 ] = "S" && PickKey
aClkObj[ 4 , 9 ] = 20 && Previous item in group
aClkObj[ 4 ,10 ] = 20 && Next item in group
aClkObj[ 4 ,11 ] = "RB_MODE_2" && ( ) ~Standalone
aClkObj[ 4 ,12 ] = []
aClkObj[ 4 ,13 ] = []
aClkObj[ 5 , 1 ] = 7 && Row
aClkObj[ 5 , 2 ] = 38 && Col
aClkObj[ 5 , 3 ] = 63 && Decimals
aClkObj[ 5 , 4 ] = 21 && CurrentId
aClkObj[ 5 , 5 ] = 17 && GroupId
aClkObj[ 5 , 6 ] = 25 && NextId
aClkObj[ 5 , 7 ] = 24 && PrevId
aClkObj[ 5 , 8 ] = "o" && PickKey
aClkObj[ 5 , 9 ] = 31 && Previous item in group
aClkObj[ 5 ,10 ] = 25 && Next item in group
aClkObj[ 5 ,11 ] = "CK_OPTI_1" && [ ] Compile ~only
aClkObj[ 5 ,12 ] = []
aClkObj[ 5 ,13 ] = []
aClkObj[ 6 , 1 ] = 8 && Row
aClkObj[ 6 , 2 ] = 38 && Col
aClkObj[ 6 , 3 ] = 63 && Decimals
aClkObj[ 6 , 4 ] = 25 && CurrentId
aClkObj[ 6 , 5 ] = 17 && GroupId
aClkObj[ 6 , 6 ] = 28 && NextId
aClkObj[ 6 , 7 ] = 21 && PrevId
aClkObj[ 6 , 8 ] = "p" && PickKey
aClkObj[ 6 , 9 ] = 21 && Previous item in group
aClkObj[ 6 ,10 ] = 28 && Next item in group
aClkObj[ 6 ,11 ] = "CK_OPTI_2" && [ ] Dis~play offending code
aClkObj[ 6 ,12 ] = []
aClkObj[ 6 ,13 ] = []
aClkObj[ 7 , 1 ] = 9 && Row
aClkObj[ 7 , 2 ] = 38 && Col
aClkObj[ 7 , 3 ] = 63 && Decimals
aClkObj[ 7 , 4 ] = 28 && CurrentId
aClkObj[ 7 , 5 ] = 17 && GroupId
aClkObj[ 7 , 6 ] = 31 && NextId
aClkObj[ 7 , 7 ] = 25 && PrevId
aClkObj[ 7 , 8 ] = "N" && PickKey
aClkObj[ 7 , 9 ] = 25 && Previous item in group
aClkObj[ 7 ,10 ] = 31 && Next item in group
aClkObj[ 7 ,11 ] = "CK_OPTI_3" && [ ] ~No warning messages
aClkObj[ 7 ,12 ] = []
aClkObj[ 7 ,13 ] = []
aClkObj[ 8 , 1 ] = 10 && Row
aClkObj[ 8 , 2 ] = 38 && Col
aClkObj[ 8 , 3 ] = 63 && Decimals
aClkObj[ 8 , 4 ] = 31 && CurrentId
aClkObj[ 8 , 5 ] = 17 && GroupId
aClkObj[ 8 , 6 ] = 37 && NextId
aClkObj[ 8 , 7 ] = 28 && PrevId
aClkObj[ 8 , 8 ] = "T" && PickKey
aClkObj[ 8 , 9 ] = 28 && Previous item in group
aClkObj[ 8 ,10 ] = 21 && Next item in group
aClkObj[ 8 ,11 ] = "CK_OPTI_4" && [ ] Set Lang~Tables on
aClkObj[ 8 ,12 ] = []
aClkObj[ 8 ,13 ] = []
aClkObj[ 9 , 1 ] = 12 && Row
aClkObj[ 9 , 2 ] = 14 && Col
aClkObj[ 9 , 3 ] = 30 && Decimals
aClkObj[ 9 , 4 ] = 37 && CurrentId
aClkObj[ 9 , 5 ] = 34 && GroupId
aClkObj[ 9 , 6 ] = 39 && NextId
aClkObj[ 9 , 7 ] = 31 && PrevId
aClkObj[ 9 , 8 ] = " " && PickKey
aClkObj[ 9 , 9 ] = 37 && Previous item in group
aClkObj[ 9 ,10 ] = 37 && Next item in group
aClkObj[ 9 ,11 ] = "CD_LIST_1" && XXXXXXXXXXXXX [v]
aClkObj[ 9 ,12 ] = []
aClkObj[ 9 ,13 ] = []
aClkObj[ 10 , 1 ] = 12 && Row
aClkObj[ 10 , 2 ] = 38 && Col
aClkObj[ 10 , 3 ] = 53 && Decimals
aClkObj[ 10 , 4 ] = 39 && CurrentId
aClkObj[ 10 , 5 ] = 39 && GroupId
aClkObj[ 10 , 6 ] = 48 && NextId
aClkObj[ 10 , 7 ] = 37 && PrevId
aClkObj[ 10 , 8 ] = "E" && PickKey
aClkObj[ 10 , 9 ] = 39 && Previous item in group
aClkObj[ 10 ,10 ] = 39 && Next item in group
aClkObj[ 10 ,11 ] = "BT_EDIT" && ~Edit file list
aClkObj[ 10 ,12 ] = []
aClkObj[ 10 ,13 ] = []
aClkObj[ 11 , 1 ] = 16 && Row
aClkObj[ 11 , 2 ] = 12 && Col
aClkObj[ 11 , 3 ] = 19 && Decimals
aClkObj[ 11 , 4 ] = 48 && CurrentId
aClkObj[ 11 , 5 ] = 48 && GroupId
aClkObj[ 11 , 6 ] = 49 && NextId
aClkObj[ 11 , 7 ] = 39 && PrevId
aClkObj[ 11 , 8 ] = " " && PickKey
aClkObj[ 11 , 9 ] = 48 && Previous item in group
aClkObj[ 11 ,10 ] = 48 && Next item in group
aClkObj[ 11 ,11 ] = "BT_OK" && Ok
aClkObj[ 11 ,12 ] = []
aClkObj[ 11 ,13 ] = []
aClkObj[ 12 , 1 ] = 16 && Row
aClkObj[ 12 , 2 ] = 24 && Col
aClkObj[ 12 , 3 ] = 31 && Decimals
aClkObj[ 12 , 4 ] = 49 && CurrentId
aClkObj[ 12 , 5 ] = 49 && GroupId
aClkObj[ 12 , 6 ] = 50 && NextId
aClkObj[ 12 , 7 ] = 48 && PrevId
aClkObj[ 12 , 8 ] = " " && PickKey
aClkObj[ 12 , 9 ] = 49 && Previous item in group
aClkObj[ 12 ,10 ] = 49 && Next item in group
aClkObj[ 12 ,11 ] = "BT_CANCEL" && Cancel
aClkObj[ 12 ,12 ] = []
aClkObj[ 12 ,13 ] = []
nCancelBt = 49
aClkObj[ 13 , 1 ] = 16 && Row
aClkObj[ 13 , 2 ] = 36 && Col
aClkObj[ 13 , 3 ] = 43 && Decimals
aClkObj[ 13 , 4 ] = 50 && CurrentId
aClkObj[ 13 , 5 ] = 50 && GroupId
aClkObj[ 13 , 6 ] = 51 && NextId
aClkObj[ 13 , 7 ] = 49 && PrevId
aClkObj[ 13 , 8 ] = " " && PickKey
aClkObj[ 13 , 9 ] = 50 && Previous item in group
aClkObj[ 13 ,10 ] = 50 && Next item in group
aClkObj[ 13 ,11 ] = "BT_HELP" && Help
aClkObj[ 13 ,12 ] = []
aClkObj[ 13 ,13 ] = []
aClkObj[ 14 , 1 ] = 16 && Row
aClkObj[ 14 , 2 ] = 48 && Col
aClkObj[ 14 , 3 ] = 65 && Decimals
aClkObj[ 14 , 4 ] = 51 && CurrentId
aClkObj[ 14 , 5 ] = 51 && GroupId
aClkObj[ 14 , 6 ] = 9 && NextId
aClkObj[ 14 , 7 ] = 50 && PrevId
aClkObj[ 14 , 8 ] = "L" && PickKey
aClkObj[ 14 , 9 ] = 51 && Previous item in group
aClkObj[ 14 ,10 ] = 51 && Next item in group
aClkObj[ 14 ,11 ] = "BT_LINK" && ~Link options ...
aClkObj[ 14 ,12 ] = []
aClkObj[ 14 ,13 ] = []
*-------------------------------------------------------------
*-- Setup object pointers in to the current object array above
*-------------------------------------------------------------
DECLARE aObjPoint[ 56 ]
aObjPoint[ 9 ] = 1
aObjPoint[ 11 ] = 2
aObjPoint[ 20 ] = 3
aObjPoint[ 24 ] = 4
aObjPoint[ 21 ] = 5
aObjPoint[ 25 ] = 6
aObjPoint[ 28 ] = 7
aObjPoint[ 31 ] = 8
aObjPoint[ 37 ] = 9
aObjPoint[ 39 ] = 10
aObjPoint[ 48 ] = 11
aObjPoint[ 49 ] = 12
aObjPoint[ 50 ] = 13
aObjPoint[ 51 ] = 14
*-------------------------------------------------------------------
*-- Setup private memory variables for object states (from InitObjs)
*-- First variable with the object memvar name contains the value
*-- for the object. The second varaible, if present, indicates
*-- the id of the object previously active in the group.
*-------------------------------------------------------------------
PRIVATE cd_file_1
cd_file_1 = ""
PRIVATE nCd_file
nCd_file = 0
PRIVATE bt_editcf
bt_editcf = ""
PRIVATE rb_mode_1
rb_mode_1 = ""
PRIVATE nRb_mode
nRb_mode = 20
PRIVATE rb_mode_2
rb_mode_2 = ""
PRIVATE ck_opti_1
ck_opti_1 = ""
PRIVATE nCk_opti
nCk_opti = 21
PRIVATE ck_opti_2
ck_opti_2 = ""
PRIVATE ck_opti_3
ck_opti_3 = ""
PRIVATE ck_opti_4
ck_opti_4 = ""
PRIVATE cd_list_1
cd_list_1 = ""
PRIVATE nCd_list
nCd_list = 0
PRIVATE bt_edit
bt_edit = ""
PRIVATE bt_ok
bt_ok = ""
PRIVATE bt_cancel
bt_cancel = ""
PRIVATE bt_help
bt_help = ""
PRIVATE bt_link
bt_link = ""
DO InitObjs
DO DrawDial && Draw all the dialog objects
*--------------------------------
*-- Set focus to the first object
*--------------------------------
DO GetNext WITH nCurrent, .T.
*-- The message loop
nMess = 0
DO WHILE .NOT. GetMess()
DO Dispatch
IF nMess = DLN_OK .OR. nMess = DLN_CANCEL
EXIT
ENDIF
ENDDO
IF nMess = DLN_OK
DO PostVals
FXL_Cancel = .F.
ELSE
FXL_Cancel = .T.
ENDIF
RELEASE WINDOW BDCOPT
RESTORE SCREEN FROM BDCOPT
RELEASE SCREEN BDCOPT
DO ReleObjs
SET COLOR OF FIELDS TO &cOldFClr
SET COLOR OF BOX TO &cOldBClr
SET COLOR OF HIGH TO &cOldHClr
SET COLOR OF MESS TO &cOldMClr
SET COLOR OF TITLE TO &cOldTClr
SET CURSOR ON
RETURN
*-- EOP: Dialog
PROCEDURE InitObjs
*----------------------------------------------------------------------------
* NAME
* InitObjs - Scan the design DBF file and initialize the object variables
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
PRIVATE cField, cClass, cDefault, Value, lInitDef
*--------------------------------------------------
*-- Determine if an initialization array is present
*--------------------------------------------------
lInitDef = TYPE( "BDCOPT[1]" ) <> "U"
*-------------------------------
*-- Set the default button value
*-------------------------------
nDlgDef = 48
*-----------------------------------------------------------------
*-- If the Initialize array is present, then set the object values
*-- based on the array.
*-----------------------------------------------------------------
IF lInitDef
CD_FILE_1 = BDCOPT[ 1 ]
BT_EDITCF = BDCOPT[ 2 ]
IF BDCOPT[ 3 ] && If this button is active
nRB_MODE = 20 && Set the tab into value to this button
ENDIF
RB_MODE_1 = BDCOPT[ 3 ]
IF BDCOPT[ 4 ] && If this button is active
nRB_MODE = 24 && Set the tab into value to this button
ENDIF
RB_MODE_2 = BDCOPT[ 4 ]
CK_OPTI_1 = BDCOPT[ 5 ]
CK_OPTI_2 = BDCOPT[ 6 ]
CK_OPTI_3 = BDCOPT[ 7 ]
CK_OPTI_4 = BDCOPT[ 8 ]
CD_LIST_1 = BDCOPT[ 9 ]
BT_EDIT = BDCOPT[ 10 ]
BT_OK = BDCOPT[ 11 ]
BT_CANCEL = BDCOPT[ 12 ]
BT_HELP = BDCOPT[ 13 ]
BT_LINK = BDCOPT[ 14 ]
ELSE
*--------------------------------------------------------
*-- Otherwise, use the values stored in the resource file
*--------------------------------------------------------
CD_FILE_1 = "*.CFG "
BT_EDITCF = .F.
RB_MODE_1 = .T.
nRB_MODE = 20 && Store the group default value
RB_MODE_2 = .F.
CK_OPTI_1 = .F.
CK_OPTI_2 = .T.
nCK_OPTI = 25 && Store the group default value
CK_OPTI_3 = .T.
nCK_OPTI = 28 && Store the group default value
CK_OPTI_4 = .F.
CD_LIST_1 = "*.PRG "
BT_EDIT = .F.
BT_OK = .T.
BT_CANCEL = .F.
BT_HELP = .F.
BT_LINK = .F.
ENDIF
nCurrent = 9 && Current dialog object id
nCurrGrp = 6 && Current group id for object id
n1stGrp = 6
RETURN
*-- EOP: InitObjs
PROCEDURE DrawDial
*----------------------------------------------------------------------------
* NAME
* DrawDial -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
PRIVATE lInitDef
lInitDef = TYPE( "BDCOPT[1]" ) <> "U"
IF FILE( "BDCOPT.WIN" ) .AND. ( .NOT. lInitDef .OR. ;
( TYPE( "FXL_NoChng" ) = "L" .AND. FXL_NoChng ) )
*--------------------
*-- Dialog box shadow
*--------------------
SAVE SCREEN TO BDCOPT
ACTIVATE SCREEN
@ 2, 9 FILL TO 20, 71
RESTORE WINDOW BDCOPT FROM BDCOPT
ACTIVATE WINDOW BDCOPT
DO TCombo WITH WM_PAINT, CB_HIDELST, 9
DO TCombo WITH WM_PAINT, CB_HIDELST, 37
ELSE
*-------------------------
*-- Draw the dialog window
*-------------------------
*--------------------
*-- Dialog box shadow
*--------------------
SAVE SCREEN TO BDCOPT
ACTIVATE SCREEN
@ 2, 9 FILL TO 20, 71
DEFINE WINDOW BDCOPT FROM 1, 8 TO 19,70 NONE COLOR n/w
ACTIVATE WINDOW BDCOPT
@ 0, 0 TO 18 , 62 DOUBLE COLOR w+/w
*------------------------
*-- Close Icon for window
*------------------------
@ 0, 2 SAY "[ ]" COLOR w+/w
@ 0, 3 SAY CHR( 254 ) COLOR g+/w
*---------------------------------
*-- Draw the other control objects
*---------------------------------
@ 0,21 SAY "[ Compiler Options ]" COLOR w+/w
@ 1,4 SAY "┌─────────────────────────────────────────────────────" COLOR n/w
@ 1,58 SAY "┐" COLOR w+/w
@ 2,4 SAY "│" COLOR n/w
@ 2,58 SAY "│" COLOR w+/w
@ 3,4 SAY "│" COLOR n/w
@ 3,58 SAY "│" COLOR w+/w
@ 4,4 SAY "│" COLOR n/w
@ 4,58 SAY "│" COLOR w+/w
@ 5,4 SAY "│" COLOR n/w
@ 5,58 SAY "│" COLOR w+/w
@ 6,4 SAY "│" COLOR n/w
@ 6,58 SAY "│" COLOR w+/w
@ 7,4 SAY "│" COLOR n/w
@ 7,58 SAY "│" COLOR w+/w
@ 8,4 SAY "│" COLOR n/w
@ 8,58 SAY "│" COLOR w+/w
@ 9,4 SAY "│" COLOR n/w
@ 9,58 SAY "│" COLOR w+/w
@ 10,4 SAY "│" COLOR n/w
@ 10,58 SAY "│" COLOR w+/w
@ 11,4 SAY "│" COLOR n/w
@ 11,58 SAY "│" COLOR w+/w
@ 12,4 SAY "│" COLOR n/w
@ 12,58 SAY "│" COLOR w+/w
@ 13,4 SAY "└" COLOR n/w
@ 13,5 SAY "─────────────────────────────────────────────────────┘" COLOR w+/w
@ 14,2 SAY "┌─────────────────────────────────────────────────────────" COLOR w+/w
@ 14,60 SAY "┐" COLOR n/w
@ 15,2 SAY "│" COLOR w+/w
@ 15,60 SAY "│" COLOR n/w
@ 16,2 SAY "│" COLOR w+/w
@ 16,60 SAY "│" COLOR n/w
@ 17,2 SAY "└" COLOR w+/w
@ 17,3 SAY "─────────────────────────────────────────────────────────┘" COLOR n/w
DO TStatic WITH WM_PAINT, BN_PAINT, 6
DO TCombo WITH WM_PAINT, CB_HIDELST, 9
DO TButton WITH WM_PAINT, BN_PAINT, 11
DO TButton WITH WM_PAINT, SE_SHADOW, 11
DO TStatic WITH WM_PAINT, BN_PAINT, 16
DO TButton WITH WM_PAINT, BN_PAINT, 20
DO TButton WITH WM_PAINT, BN_PAINT, 24
DO TStatic WITH WM_PAINT, BN_PAINT, 17
DO TButton WITH WM_PAINT, BN_PAINT, 21
DO TButton WITH WM_PAINT, BN_PAINT, 25
DO TButton WITH WM_PAINT, BN_PAINT, 28
DO TButton WITH WM_PAINT, BN_PAINT, 31
DO TStatic WITH WM_PAINT, BN_PAINT, 34
DO TCombo WITH WM_PAINT, CB_HIDELST, 37
DO TButton WITH WM_PAINT, BN_PAINT, 39
DO TButton WITH WM_PAINT, SE_SHADOW, 39
DO TButton WITH WM_PAINT, BN_PAINT, 48
DO TButton WITH WM_PAINT, SE_SHADOW, 48
DO TButton WITH WM_PAINT, BN_PAINT, 49
DO TButton WITH WM_PAINT, SE_SHADOW, 49
DO TButton WITH WM_PAINT, BN_PAINT, 50
DO TButton WITH WM_PAINT, SE_SHADOW, 50
DO TButton WITH WM_PAINT, BN_PAINT, 51
DO TButton WITH WM_PAINT, SE_SHADOW, 51
IF .NOT. lInitDef
SAVE WINDOW BDCOPT TO BDCOPT
ENDIF
ENDIF
RETURN
*-- EOP: DrawDial
PROCEDURE TStatic
PARAMETERS pn_msg, pc_data, pnObject
*----------------------------------------------------------------------------
* NAME
* TStatic -
*
* DESCRIPTION
*
* PARAMETERS
* pn_msg =
* pc_data =
* pnObject =
*
*----------------------------------------------------------------------------
DO CASE
CASE pnObject = 6
DO CASE
CASE pc_data = BN_PAINT .OR. pc_data = BN_UNHILITE
@ 2, 6 SAY 'CFG file name' COLOR n/w
CASE pc_data = BN_HILITE
@ 2, 6 SAY 'CFG file name' COLOR w+/w
CASE pc_data = BN_DISABLE
@ 2, 6 SAY 'CFG file name' COLOR n+/w
CASE pc_data = BN_COLOR
@ 2, 6 SAY "CF~G file name" COLOR n/w
ENDCASE
IF pc_data <> BN_DISABLE
@ 2, 8 SAY "G" COLOR gr+/w
ENDIF
CASE pnObject = 16
DO CASE
CASE pc_data = BN_PAINT .OR. pc_data = BN_UNHILITE
@ 5, 6 SAY "Model" COLOR n/w
CASE pc_data = BN_HILITE
@ 5, 6 SAY "Model" COLOR w+/w
CASE pc_data = BN_DISABLE
@ 5, 6 SAY "Model" COLOR n+/w
CASE pc_data = BN_COLOR
@ 5, 6 SAY "Model" COLOR n/w
ENDCASE
CASE pnObject = 17
DO CASE
CASE pc_data = BN_PAINT .OR. pc_data = BN_UNHILITE
@ 5, 30 SAY "Compile Options" COLOR n/w
CASE pc_data = BN_HILITE
@ 5, 30 SAY "Compile Options" COLOR w+/w
CASE pc_data = BN_DISABLE
@ 5, 30 SAY "Compile Options" COLOR n+/w
CASE pc_data = BN_COLOR
@ 5, 30 SAY "Compile Options" COLOR n/w
ENDCASE
CASE pnObject = 34
DO CASE
CASE pc_data = BN_PAINT .OR. pc_data = BN_UNHILITE
@ 10, 6 SAY 'File list name' COLOR n/w
CASE pc_data = BN_HILITE
@ 10, 6 SAY 'File list name' COLOR w+/w
CASE pc_data = BN_DISABLE
@ 10, 6 SAY 'File list name' COLOR n+/w
CASE pc_data = BN_COLOR
@ 10, 6 SAY "~File list name" COLOR n/w
ENDCASE
IF pc_data <> BN_DISABLE
@ 10, 6 SAY "F" COLOR gr+/w
ENDIF
ENDCASE
RETURN
*-- EOP: TStatic WITH pn_msg, pc_data, pnObject
PROCEDURE HasTitle
PARAMETERS pnObject, pnWay
*----------------------------------------------------------------------------
* NAME
* HasTitle - Display the label for the group of objects
*
* DESCRIPTION
*
* PARAMETERS
* pnObject = nCurrent value for group item
* pnWay = BN_HILITE, BN_UNHILITE, or BN_DISABLE
*
*----------------------------------------------------------------------------
DO CASE
CASE pnObject = 9
DO TStatic WITH WM_PAINT, pnWay, 6
CASE pnObject = 20
DO TStatic WITH WM_PAINT, pnWay, 16
CASE pnObject = 24
DO TStatic WITH WM_PAINT, pnWay, 16
CASE pnObject = 21
DO TStatic WITH WM_PAINT, pnWay, 17
CASE pnObject = 25
DO TStatic WITH WM_PAINT, pnWay, 17
CASE pnObject = 28
DO TStatic WITH WM_PAINT, pnWay, 17
CASE pnObject = 31
DO TStatic WITH WM_PAINT, pnWay, 17
CASE pnObject = 37
DO TStatic WITH WM_PAINT, pnWay, 34
ENDCASE
*-- EOP: HasTitle WITH pnObject, pnWay
FUNCTION GetMess
*----------------------------------------------------------------------------
* NAME
* GetMess() -
* DEPENDENCIES
* Uses nCurrent to determine the wait state for the given object.
*----------------------------------------------------------------------------
PRIVATE lRtn
DO CASE
CASE nCurrent = 9 && CD_FILE_1
DO GetDD
CASE nCurrent = 11 && BT_EDITCF
DO TButton WITH WM_PAINT, BN_UNHILITE, 48
BT_EDITCF = .F.
DO GetWait
CASE nCurrent = 20 && RB_MODE_1
DO GetWait
CASE nCurrent = 24 && RB_MODE_2
DO GetWait
CASE nCurrent = 21 && CK_OPTI_1
DO GetWait
CASE nCurrent = 25 && CK_OPTI_2
DO GetWait
CASE nCurrent = 28 && CK_OPTI_3
DO GetWait
CASE nCurrent = 31 && CK_OPTI_4
DO GetWait
CASE nCurrent = 37 && CD_LIST_1
DO GetDD
CASE nCurrent = 39 && BT_EDIT
DO TButton WITH WM_PAINT, BN_UNHILITE, 48
BT_EDIT = .F.
DO GetWait
CASE nCurrent = 48 && BT_OK
DO GetWait
CASE nCurrent = 49 && BT_CANCEL
DO TButton WITH WM_PAINT, BN_UNHILITE, 48
BT_CANCEL = .F.
DO GetWait
CASE nCurrent = 50 && BT_HELP
DO TButton WITH WM_PAINT, BN_UNHILITE, 48
BT_HELP = .F.
DO GetWait
CASE nCurrent = 51 && BT_LINK
DO TButton WITH WM_PAINT, BN_UNHILITE, 48
BT_LINK = .F.
DO GetWait
ENDCASE
IF nMess = KB_F1
DO _HelpSys WITH cDialog, ;
LEFT( TRANSFORM( aObjPoint[ nCurrent ], "@L 99" ) + ;
aClkObj[ aObjPoint[ nCurrent ], 11 ], 10 ), ;
cHelpFile
ENDIF
IF nMess = KB_ESC
lRtn = .T.
ELSE
lRtn = .F.
ENDIF
RETURN lRtn
*-- EOF: GetMess( )
PROCEDURE GetWait
*----------------------------------------------------------------------------
* NAME
* GetWait -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
nMess = 0
nAccel = 0
lButtAct = .T.
DO TButton WITH WM_PAINT, BN_HILITE, nCurrent
SET CONSOLE OFF
SET CURSOR OFF
WAIT
SET CONSOLE ON
nMess = LASTKEY()
nMRow = MROW()
nMCol = MCOL()
RETURN
*-- EOP: GetWait
PROCEDURE TButton
PARAMETERS pn_msg, pc_data, pnObject
*----------------------------------------------------------------------------
* NAME
* TButton -
*
* DESCRIPTION
*
* PARAMETERS
* pn_msg =
* pc_data =
* pnObject =
*
*----------------------------------------------------------------------------
DO CASE
CASE pnObject = 11 && BT_EDITCF
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT
@ 3, 30 SAY ' Edit config file ' COLOR n/g
CASE pc_data = BN_HILITE
@ 3, 30 SAY ' Edit config file ' COLOR w+/g
CASE pc_data = BN_UNHILITE
@ 3, 30 SAY ' Edit config file ' COLOR n/g
CASE pc_data = BN_DEFAULT
@ 3, 30 SAY ' Edit config file ' COLOR bg+/g
CASE pc_data = BN_DISABLE
@ 3, 30 SAY ' Edit config file ' COLOR n+/g
CASE pc_data = SE_SHADOW
@ 4, 31 SAY "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀"
@ 3, 48 SAY "▄"
CASE pc_data = BN_PRESSED
@ 4, 31 SAY SPACE( 18 )
@ 3, 30 SAY " "
@ 3, 48 SAY " "
@ 3, 31 SAY ' Edit config file ' COLOR w+/g
ENDCASE
IF pc_data <> BN_PRESSED .AND. pc_data <> BN_DISABLE
@ 3, 32 SAY "d" COLOR gr+/g
ENDIF
CASE pn_msg = BN_CLICKED
DO TButton WITH WM_PAINT, BN_PRESSED, 11
IF BDCEdit( [BT_EDITCF] )
ENDIF
DO TButton WITH WM_PAINT, BN_PAINT, 11
DO TButton WITH WM_PAINT, SE_SHADOW, 11
ENDCASE
CASE pnObject = 20 && RB_MODE_1
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT .OR. pc_data = BN_UNHILITE
@ 6, 6 SAY '( ) Compact ' COLOR n/gb
IF RB_MODE_1
@ 6, 7 TO 6, 7 7 COLOR n/gb
ELSE
@ 6, 7 SAY " " COLOR n/gb
ENDIF
CASE pc_data = BN_HILITE
@ 6, 6 SAY '( ) Compact ' COLOR w+/gb
IF RB_MODE_1
@ 6, 7 TO 6, 7 7 COLOR w+/gb
ELSE
@ 6, 7 SAY " " COLOR w+/gb
ENDIF
CASE pc_data = BN_DISABLE
@ 6, 6 SAY '( ) Compact ' COLOR n+/gb
IF RB_MODE_1
@ 6, 7 TO 6, 7 7 COLOR n+/gb
ELSE
@ 6, 7 SAY " " COLOR n+/gb
ENDIF
ENDCASE
IF pc_data <> BN_DISABLE
@ 6, 10 SAY "C" COLOR gr+/gb
ENDIF
CASE pn_msg = BN_CLICKED
IF RB_MODE_1
STORE .F. TO RB_MODE_1
ELSE
STORE .T. TO RB_MODE_1
ENDIF
ENDCASE
CASE pnObject = 24 && RB_MODE_2
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT .OR. pc_data = BN_UNHILITE
@ 7, 6 SAY '( ) Standalone' COLOR n/gb
IF RB_MODE_2
@ 7, 7 TO 7, 7 7 COLOR n/gb
ELSE
@ 7, 7 SAY " " COLOR n/gb
ENDIF
CASE pc_data = BN_HILITE
@ 7, 6 SAY '( ) Standalone' COLOR w+/gb
IF RB_MODE_2
@ 7, 7 TO 7, 7 7 COLOR w+/gb
ELSE
@ 7, 7 SAY " " COLOR w+/gb
ENDIF
CASE pc_data = BN_DISABLE
@ 7, 6 SAY '( ) Standalone' COLOR n+/gb
IF RB_MODE_2
@ 7, 7 TO 7, 7 7 COLOR n+/gb
ELSE
@ 7, 7 SAY " " COLOR n+/gb
ENDIF
ENDCASE
IF pc_data <> BN_DISABLE
@ 7, 10 SAY "S" COLOR gr+/gb
ENDIF
CASE pn_msg = BN_CLICKED
IF RB_MODE_2
STORE .F. TO RB_MODE_2
ELSE
STORE .T. TO RB_MODE_2
ENDIF
ENDCASE
CASE pnObject = 21 && CK_OPTI_1
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT .OR. pc_data = BN_UNHILITE
@ 6, 30 SAY '[ ] Compile only ' COLOR n/gb
@ 6, 31 SAY IIF( CK_OPTI_1 , "X"," " ) COLOR n/gb
CASE pc_data = BN_HILITE
@ 6, 30 SAY '[ ] Compile only ' COLOR w+/gb
@ 6, 31 SAY IIF( CK_OPTI_1 , "X"," " ) COLOR w+/gb
CASE pc_data = BN_DISABLE
@ 6, 30 SAY '[ ] Compile only ' COLOR n+/gb
@ 6, 31 SAY IIF( CK_OPTI_1 , "X"," " ) COLOR n+/gb
ENDCASE
IF pc_data <> BN_DISABLE
@ 6, 42 SAY "o" COLOR gr+/gb
ENDIF
CASE pn_msg = BN_CLICKED
IF CK_OPTI_1
STORE .F. TO CK_OPTI_1
ELSE
STORE .T. TO CK_OPTI_1
ENDIF
DO TButton WITH WM_PAINT, BN_HILITE, 21
ENDCASE
CASE pnObject = 25 && CK_OPTI_2
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT .OR. pc_data = BN_UNHILITE
@ 7, 30 SAY '[ ] Display offending code' COLOR n/gb
@ 7, 31 SAY IIF( CK_OPTI_2 , "X"," " ) COLOR n/gb
CASE pc_data = BN_HILITE
@ 7, 30 SAY '[ ] Display offending code' COLOR w+/gb
@ 7, 31 SAY IIF( CK_OPTI_2 , "X"," " ) COLOR w+/gb
CASE pc_data = BN_DISABLE
@ 7, 30 SAY '[ ] Display offending code' COLOR n+/gb
@ 7, 31 SAY IIF( CK_OPTI_2 , "X"," " ) COLOR n+/gb
ENDCASE
IF pc_data <> BN_DISABLE
@ 7, 37 SAY "p" COLOR gr+/gb
ENDIF
CASE pn_msg = BN_CLICKED
IF CK_OPTI_2
STORE .F. TO CK_OPTI_2
ELSE
STORE .T. TO CK_OPTI_2
ENDIF
DO TButton WITH WM_PAINT, BN_HILITE, 25
ENDCASE
CASE pnObject = 28 && CK_OPTI_3
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT .OR. pc_data = BN_UNHILITE
@ 8, 30 SAY '[ ] No warning messages ' COLOR n/gb
@ 8, 31 SAY IIF( CK_OPTI_3 , "X"," " ) COLOR n/gb
CASE pc_data = BN_HILITE
@ 8, 30 SAY '[ ] No warning messages ' COLOR w+/gb
@ 8, 31 SAY IIF( CK_OPTI_3 , "X"," " ) COLOR w+/gb
CASE pc_data = BN_DISABLE
@ 8, 30 SAY '[ ] No warning messages ' COLOR n+/gb
@ 8, 31 SAY IIF( CK_OPTI_3 , "X"," " ) COLOR n+/gb
ENDCASE
IF pc_data <> BN_DISABLE
@ 8, 34 SAY "N" COLOR gr+/gb
ENDIF
CASE pn_msg = BN_CLICKED
IF CK_OPTI_3
STORE .F. TO CK_OPTI_3
ELSE
STORE .T. TO CK_OPTI_3
ENDIF
DO TButton WITH WM_PAINT, BN_HILITE, 28
ENDCASE
CASE pnObject = 31 && CK_OPTI_4
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT .OR. pc_data = BN_UNHILITE
@ 9, 30 SAY '[ ] Set LangTables on ' COLOR n/gb
@ 9, 31 SAY IIF( CK_OPTI_4 , "X"," " ) COLOR n/gb
CASE pc_data = BN_HILITE
@ 9, 30 SAY '[ ] Set LangTables on ' COLOR w+/gb
@ 9, 31 SAY IIF( CK_OPTI_4 , "X"," " ) COLOR w+/gb
CASE pc_data = BN_DISABLE
@ 9, 30 SAY '[ ] Set LangTables on ' COLOR n+/gb
@ 9, 31 SAY IIF( CK_OPTI_4 , "X"," " ) COLOR n+/gb
ENDCASE
IF pc_data <> BN_DISABLE
@ 9, 42 SAY "T" COLOR gr+/gb
ENDIF
CASE pn_msg = BN_CLICKED
IF CK_OPTI_4
STORE .F. TO CK_OPTI_4
ELSE
STORE .T. TO CK_OPTI_4
ENDIF
DO TButton WITH WM_PAINT, BN_HILITE, 31
ENDCASE
CASE pnObject = 39 && BT_EDIT
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT
@ 11, 30 SAY ' Edit file list ' COLOR n/g
CASE pc_data = BN_HILITE
@ 11, 30 SAY ' Edit file list ' COLOR w+/g
CASE pc_data = BN_UNHILITE
@ 11, 30 SAY ' Edit file list ' COLOR n/g
CASE pc_data = BN_DEFAULT
@ 11, 30 SAY ' Edit file list ' COLOR bg+/g
CASE pc_data = BN_DISABLE
@ 11, 30 SAY ' Edit file list ' COLOR n+/g
CASE pc_data = SE_SHADOW
@ 12, 31 SAY "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀"
@ 11, 46 SAY "▄"
CASE pc_data = BN_PRESSED
@ 12, 31 SAY SPACE( 16 )
@ 11, 30 SAY " "
@ 11, 46 SAY " "
@ 11, 31 SAY ' Edit file list ' COLOR w+/g
ENDCASE
IF pc_data <> BN_PRESSED .AND. pc_data <> BN_DISABLE
@ 11, 31 SAY "E" COLOR gr+/g
ENDIF
CASE pn_msg = BN_CLICKED
DO TButton WITH WM_PAINT, BN_PRESSED, 39
IF BDCEdit( [BT_EDIT] )
ENDIF
DO TButton WITH WM_PAINT, BN_PAINT, 39
DO TButton WITH WM_PAINT, SE_SHADOW, 39
ENDCASE
CASE pnObject = 48 && BT_OK
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT
@ 15, 4 SAY ' Ok ' COLOR bg+/g
CASE pc_data = BN_HILITE
@ 15, 4 SAY ' Ok ' COLOR w+/g
CASE pc_data = BN_UNHILITE
@ 15, 4 SAY ' Ok ' COLOR n/g
CASE pc_data = BN_DEFAULT
@ 15, 4 SAY ' Ok ' COLOR bg+/g
CASE pc_data = BN_DISABLE
@ 15, 4 SAY ' Ok ' COLOR n+/g
CASE pc_data = SE_SHADOW
@ 16, 5 SAY "▀▀▀▀▀▀▀▀"
@ 15, 12 SAY "▄"
CASE pc_data = BN_PRESSED
@ 16, 5 SAY SPACE( 8 )
@ 15, 4 SAY " "
@ 15, 12 SAY " "
@ 15, 5 SAY ' Ok ' COLOR w+/g
ENDCASE
CASE pn_msg = BN_CLICKED
DO TButton WITH WM_PAINT, BN_PRESSED, 48
IF BDCOk()
nMess = DLN_OK
ENDIF
x = INKEY( .2 )
DO TButton WITH WM_PAINT, BN_PAINT, 48
DO TButton WITH WM_PAINT, SE_SHADOW, 48
ENDCASE
CASE pnObject = 49 && BT_CANCEL
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT
@ 15, 16 SAY ' Cancel ' COLOR n/g
CASE pc_data = BN_HILITE
@ 15, 16 SAY ' Cancel ' COLOR w+/g
CASE pc_data = BN_UNHILITE
@ 15, 16 SAY ' Cancel ' COLOR n/g
CASE pc_data = BN_DEFAULT
@ 15, 16 SAY ' Cancel ' COLOR bg+/g
CASE pc_data = BN_DISABLE
@ 15, 16 SAY ' Cancel ' COLOR n+/g
CASE pc_data = SE_SHADOW
@ 16, 17 SAY "▀▀▀▀▀▀▀▀"
@ 15, 24 SAY "▄"
CASE pc_data = BN_PRESSED
@ 16, 17 SAY SPACE( 8 )
@ 15, 16 SAY " "
@ 15, 24 SAY " "
@ 15, 17 SAY ' Cancel ' COLOR w+/g
ENDCASE
CASE pn_msg = BN_CLICKED
DO TButton WITH WM_PAINT, BN_PRESSED, 49
x = INKEY( .2 )
nMess = DLN_CANCEL
DO TButton WITH WM_PAINT, BN_PAINT, 49
DO TButton WITH WM_PAINT, SE_SHADOW, 49
ENDCASE
CASE pnObject = 50 && BT_HELP
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT
@ 15, 28 SAY ' Help ' COLOR n/g
CASE pc_data = BN_HILITE
@ 15, 28 SAY ' Help ' COLOR w+/g
CASE pc_data = BN_UNHILITE
@ 15, 28 SAY ' Help ' COLOR n/g
CASE pc_data = BN_DEFAULT
@ 15, 28 SAY ' Help ' COLOR bg+/g
CASE pc_data = BN_DISABLE
@ 15, 28 SAY ' Help ' COLOR n+/g
CASE pc_data = SE_SHADOW
@ 16, 29 SAY "▀▀▀▀▀▀▀▀"
@ 15, 36 SAY "▄"
CASE pc_data = BN_PRESSED
@ 16, 29 SAY SPACE( 8 )
@ 15, 28 SAY " "
@ 15, 36 SAY " "
@ 15, 29 SAY ' Help ' COLOR w+/g
ENDCASE
CASE pn_msg = BN_CLICKED
DO TButton WITH WM_PAINT, BN_PRESSED, 50
DO _HelpSys WITH cDialog, ;
LEFT( TRANSFORM( aObjPoint[ nCurrent ], "@L 99" ) + ;
aClkObj[ aObjPoint[ nCurrent ], 11 ], 10 ), ;
cHelpFile
DO TButton WITH WM_PAINT, BN_PAINT, 50
DO TButton WITH WM_PAINT, SE_SHADOW, 50
ENDCASE
CASE pnObject = 51 && BT_LINK
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE pc_data = BN_PAINT
@ 15, 40 SAY ' Link options ... ' COLOR n/g
CASE pc_data = BN_HILITE
@ 15, 40 SAY ' Link options ... ' COLOR w+/g
CASE pc_data = BN_UNHILITE
@ 15, 40 SAY ' Link options ... ' COLOR n/g
CASE pc_data = BN_DEFAULT
@ 15, 40 SAY ' Link options ... ' COLOR bg+/g
CASE pc_data = BN_DISABLE
@ 15, 40 SAY ' Link options ... ' COLOR n+/g
CASE pc_data = SE_SHADOW
@ 16, 41 SAY "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀"
@ 15, 58 SAY "▄"
CASE pc_data = BN_PRESSED
@ 16, 41 SAY SPACE( 18 )
@ 15, 40 SAY " "
@ 15, 58 SAY " "
@ 15, 41 SAY ' Link options ... ' COLOR w+/g
ENDCASE
IF pc_data <> BN_PRESSED .AND. pc_data <> BN_DISABLE
@ 15, 41 SAY "L" COLOR gr+/g
ENDIF
CASE pn_msg = BN_CLICKED
DO TButton WITH WM_PAINT, BN_PRESSED, 51
IF BDLDrvr()
ENDIF
DO TButton WITH WM_PAINT, BN_PAINT, 51
DO TButton WITH WM_PAINT, SE_SHADOW, 51
ENDCASE
ENDCASE
RETURN
*-- EOP: TButton WITH pn_msg, pc_data, pnObject
PROCEDURE TList
PARAMETERS pn_msg, p__data, pnObject
*----------------------------------------------------------------------------
* NAME
* TList -
*
* DESCRIPTION
*
* PARAMETERS
* pn_msg =
* p__data =
* pnObject =
*
*----------------------------------------------------------------------------
PRIVATE cPopDef
cPopDef = ""
DO CASE
CASE pnObject = 9
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE p__data = LBN_KILLFO
DO HasTitle WITH nCurrent, BN_UNHILITE
CASE p__data = WM_DRAWITEM
SET COLOR OF MESS TO n/gb
SET COLOR OF TITLE TO n/gb
IF ISBLANK( CD_FILE_1 )
DEFINE POPUP Cd_file_1 FROM 4, 7 TO 18, 21 PROMPT FILES LIKE *.*
ELSE
DEFINE POPUP Cd_file_1 FROM 4, 7 TO 18, 21 PROMPT FILES LIKE &CD_FILE_1
ENDIF
SHOW POPUP CD_FILE_1
ENDCASE
CASE pn_msg = LBN_SETFOC
SET COLOR OF MESS TO n/gb
SET COLOR OF TITLE TO n/gb
nMsEvent = 0
nMess = 0
nAccel = 0 && dBRIEF Tag...
pl_IsPop = .T.
ON MOUSE DO MsHand WITH MROW(), MCOL(), .T.
DO SetOnKey
ON KEY LABEL Tab DO TabOut WITH KB_TAB
ON KEY LABEL BackTab DO TabOut WITH KB_SHIFTTAB
lOk = .T.
ON ERROR lOk = .F.
ON POPUP CD_FILE_1 DO TList WITH LBN_SELCHA, .F., nCurrent
ON ERROR
IF .NOT. lOk
DO TList WITH WM_PAINT, WM_DRAWITEM, nCurrent
ON POPUP CD_FILE_1 DO TList WITH LBN_SELCHA, .F., nCurrent
ENDIF
ON SELECTION POPUP CD_FILE_1 DO TList WITH LBN_DBLCLK, .F., nCurrent
*---------------------------------------------
*-- Keyboard to position bar at last selection
*---------------------------------------------
IF .NOT. ISBLANK( CATALOG() )
n = nCD_FILE - 2
ELSE
IF nCD_FILE = 3
n = 0
ELSE
n = nCD_FILE - 3
ENDIF
ENDIF
IF n > 0
i = 1
DO WHILE i < n
KEYBOARD [{DnArrow}]
i = i + 1
ENDDO
ENDIF
ACTIVATE POPUP CD_FILE_1
ON KEY LABEL Tab
ON KEY LABEL BackTab
DO ClrOnKey
ON MOUSE
pl_IsPop = .F. && dBRIEF Tag...
IF BAR() > 0
nMess = KB_ENTER
ON ERROR lOk = .F.
RESTORE SCREEN FROM CD_FILE_1
RELEASE SCREEN CD_FILE_1
ON ERROR
ELSE
IF nMess = 0
IF nMsEvent = KB_MOUSE
nMess = KB_MOUSE
RESTORE SCREEN FROM CD_FILE_1
RELEASE SCREEN CD_FILE_1
ELSE
nMess = LASTKEY()
ENDIF
ELSE
ON ERROR lOk = .F.
RESTORE SCREEN FROM CD_FILE_1
RELEASE SCREEN CD_FILE_1
ON ERROR lOk = .F.
ENDIF
ENDIF
CASE pn_msg = LBN_SELCHA
*-- ON POPUP Handler here
IF pnObject = 9
IF BDCFill( [CD_FILE_1] )
ENDIF
ENDIF
CASE pn_msg = LBN_DBLCLK
SAVE SCREEN TO CD_FILE_1
STORE BAR() TO nCD_FILE
DEACTIVATE POPUP
ENDCASE
CASE pnObject = 37
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE p__data = LBN_KILLFO
DO HasTitle WITH nCurrent, BN_UNHILITE
CASE p__data = WM_DRAWITEM
SET COLOR OF MESS TO n/gb
SET COLOR OF TITLE TO n/gb
IF ISBLANK( CD_LIST_1 )
DEFINE POPUP Cd_list_1 FROM 12, 7 TO 18, 22 PROMPT FILES LIKE *.*
ELSE
DEFINE POPUP Cd_list_1 FROM 12, 7 TO 18, 22 PROMPT FILES LIKE &CD_LIST_1
ENDIF
SHOW POPUP CD_LIST_1
ENDCASE
CASE pn_msg = LBN_SETFOC
SET COLOR OF MESS TO n/gb
SET COLOR OF TITLE TO n/gb
nMsEvent = 0
nMess = 0
nAccel = 0 && dBRIEF Tag...
pl_IsPop = .T.
ON MOUSE DO MsHand WITH MROW(), MCOL(), .T.
DO SetOnKey
ON KEY LABEL Tab DO TabOut WITH KB_TAB
ON KEY LABEL BackTab DO TabOut WITH KB_SHIFTTAB
lOk = .T.
ON ERROR lOk = .F.
ON POPUP CD_LIST_1 DO TList WITH LBN_SELCHA, .F., nCurrent
ON ERROR
IF .NOT. lOk
DO TList WITH WM_PAINT, WM_DRAWITEM, nCurrent
ON POPUP CD_LIST_1 DO TList WITH LBN_SELCHA, .F., nCurrent
ENDIF
ON SELECTION POPUP CD_LIST_1 DO TList WITH LBN_DBLCLK, .F., nCurrent
*---------------------------------------------
*-- Keyboard to position bar at last selection
*---------------------------------------------
IF .NOT. ISBLANK( CATALOG() )
n = nCD_LIST - 2
ELSE
IF nCD_LIST = 3
n = 0
ELSE
n = nCD_LIST - 3
ENDIF
ENDIF
IF n > 0
i = 1
DO WHILE i < n
KEYBOARD [{DnArrow}]
i = i + 1
ENDDO
ENDIF
ACTIVATE POPUP CD_LIST_1
ON KEY LABEL Tab
ON KEY LABEL BackTab
DO ClrOnKey
ON MOUSE
pl_IsPop = .F. && dBRIEF Tag...
IF BAR() > 0
nMess = KB_ENTER
ON ERROR lOk = .F.
RESTORE SCREEN FROM CD_LIST_1
RELEASE SCREEN CD_LIST_1
ON ERROR
ELSE
IF nMess = 0
IF nMsEvent = KB_MOUSE
nMess = KB_MOUSE
RESTORE SCREEN FROM CD_LIST_1
RELEASE SCREEN CD_LIST_1
ELSE
nMess = LASTKEY()
ENDIF
ELSE
ON ERROR lOk = .F.
RESTORE SCREEN FROM CD_LIST_1
RELEASE SCREEN CD_LIST_1
ON ERROR lOk = .F.
ENDIF
ENDIF
CASE pn_msg = LBN_SELCHA
*-- ON POPUP Handler here
CASE pn_msg = LBN_DBLCLK
SAVE SCREEN TO CD_LIST_1
STORE BAR() TO nCD_LIST
DEACTIVATE POPUP
ENDCASE
ENDCASE
RETURN
*-- EOP: TList WITH pn_msg, p__data, pnObject
PROCEDURE TabOut
PARAMETERS pn_Key
*----------------------------------------------------------------------------
* NAME
* TabOut -
*
* DESCRIPTION
*
* PARAMETERS
* pn_Key =
*
*----------------------------------------------------------------------------
PRIVATE nRow, nCol, cPath, cPrompt, cDrive
nRow = ROW()
nCol = COL()
DO CASE
CASE nCurrent = 9
STORE BAR() TO nCD_FILE
*-- Redisplay the bar because of a "feature" in dBASE
cPrompt = TRIM( PROMPT() )
cDrive = _FileDrv( cPrompt )
IF .NOT. ISBLANK( cDrive )
cPath = cDrive + ":" + _FilePath( cPrompt )
ELSE
cPath = _FilePath( cPrompt )
ENDIF
cPrompt = TRIM( SUBSTR( cPrompt, LEN( cPath )+1 ) )
cPrompt = LEFT( cPrompt + SPACE( 13 ), 13 )
@ nRow, nCol SAY cPrompt COLOR w+/g
SAVE SCREEN TO CD_FILE_1
nMess = pn_Key
KEYBOARD "{LeftArrow}"
CASE nCurrent = 37
STORE BAR() TO nCD_LIST
*-- Redisplay the bar because of a "feature" in dBASE
cPrompt = TRIM( PROMPT() )
cDrive = _FileDrv( cPrompt )
IF .NOT. ISBLANK( cDrive )
cPath = cDrive + ":" + _FilePath( cPrompt )
ELSE
cPath = _FilePath( cPrompt )
ENDIF
cPrompt = TRIM( SUBSTR( cPrompt, LEN( cPath )+1 ) )
cPrompt = LEFT( cPrompt + SPACE( 14 ), 14 )
@ nRow, nCol SAY cPrompt COLOR w+/g
SAVE SCREEN TO CD_LIST_1
nMess = pn_Key
KEYBOARD "{LeftArrow}"
ENDCASE
RETURN
*-- EOP: TabOut WITH pn_Key
PROCEDURE TCombo
PARAMETERS pn_msg, p__data, pnObject
*----------------------------------------------------------------------------
* NAME
* TCombo -
*
* DESCRIPTION
*
* PARAMETERS
* pn_msg =
* p__data =
* pnObject =
*
*----------------------------------------------------------------------------
PRIVATE cDisplay
DO CASE
CASE pnObject = 9
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE p__data = CBN_KILLFOC
DO HasTitle WITH pnObject, BN_UNHILITE
CASE p__data = CB_HIDELST
@ 3, 6 GET CD_FILE_1 PICTURE 'XXXXXXXXXXXXX'
@ 3, 19 SAY CHR(222) COLOR g/w
@ 3, 20 SAY CHR(25) COLOR n/g
@ 3, 21 SAY CHR(221) COLOR g/w
CLEAR GETS
CASE p__data = CB_SHOWDRO
DO TList WITH WM_PAINT, WM_DRAWITEM, pnObject
ENDCASE
CASE pn_msg = CBN_DROPDOW
SAVE SCREEN TO Tcombo
DO TCombo WITH WM_PAINT, CB_SHOWDRO, pnObject
DO TCombo WITH CBN_INLIST, .F., pnObject
DO TCombo WITH WM_PAINT, CB_HIDELST, pnObject
RESTORE SCREEN FROM Tcombo
RELEASE SCREEN Tcombo
@ 3, 6 GET CD_FILE_1 PICTURE 'XXXXXXXXXXXXX'
CLEAR GETS
CASE pn_msg = CB_SELECTS
*-----------------------------------------------------
*-- Do not repaint the get area during scroll re-entry
*-----------------------------------------------------
IF nCd_file > 0
IF BAR() <> nCd_file
RETURN
ELSE
nCd_file = 0
ENDIF
ENDIF
IF TYPE( "p__data" ) = "L"
cPrompt = PROMPT()
ELSE
cPrompt = p__data
ENDIF
cFileRoot = _FileRoot( cPrompt )
IF .NOT. "<" $ cFileRoot
STORE cFileRoot + "." + _FileType( cPrompt ) TO cDisplay
STORE LEFT( cPrompt + SPACE( 80 ), 80 ) TO CD_FILE_1
STORE LEFT( cDisplay + SPACE( 80 ), 80 ) TO cDisplay
@ 3 , 6 GET cDisplay PICTURE 'XXXXXXXXXXXXX'
CLEAR GETS
ENDIF
CASE pn_msg = CBN_INLIST
SET COLOR OF MESS TO n/gb
SET COLOR OF TITLE TO n/gb
nMsEvent = 0
nMess = 0
nAccel = 0
pl_IsPop = .T.
ON MOUSE DO MsHand WITH MROW(), MCOL(), .T.
DO SetOnKey
ON KEY LABEL Tab DO TabOut WITH KB_TAB
ON KEY LABEL BackTab DO TabOut WITH KB_SHIFTTAB
ON POPUP CD_FILE_1 DO TCombo WITH CB_SELECTS, .F., pnObject
ON SELECTION POPUP CD_FILE_1 DO TComboSel
*-------------------------------------------------
*-- Keyboard in down arrows to match prompt string
*-------------------------------------------------
IF nCd_file > 0
n = 1
nHowMany = nCd_file - 1
IF ISBLANK( CATALOG() )
nHowMany = nHowMany - 3
ELSE
nHowMany = nHowMany - 2
ENDIF
DO WHILE n <= nHowMany
KEYBOARD [{DnArrow}]
n = n + 1
ENDDO
ENDIF
ACTIVATE POPUP CD_FILE_1
pl_IsPop = .F.
ON KEY LABEL Tab
ON KEY LABEL BackTab
DO ClrOnKey
ON MOUSE
IF BAR() > 0
nMess = KB_ENTER
nCd_file = BAR()
ELSE
IF nMess = 0
IF nMsEvent = KB_MOUSE
nMess = KB_MOUSE
RESTORE SCREEN FROM CD_FILE_1
RELEASE SCREEN CD_FILE_1
ELSE
nMess = LASTKEY()
ENDIF
ELSE
RESTORE SCREEN FROM CD_FILE_1
RELEASE SCREEN CD_FILE_1
ENDIF
ENDIF
ENDCASE
CASE pnObject = 37
DO CASE
CASE pn_msg = WM_PAINT
DO CASE
CASE p__data = CBN_KILLFOC
DO HasTitle WITH pnObject, BN_UNHILITE
CASE p__data = CB_HIDELST
@ 11, 6 GET CD_LIST_1 PICTURE 'XXXXXXXXXXXXX'
@ 11, 19 SAY CHR(222) COLOR g/w
@ 11, 20 SAY CHR(25) COLOR n/g
@ 11, 21 SAY CHR(221) COLOR g/w
CLEAR GETS
CASE p__data = CB_SHOWDRO
DO TList WITH WM_PAINT, WM_DRAWITEM, pnObject
ENDCASE
CASE pn_msg = CBN_DROPDOW
SAVE SCREEN TO Tcombo
DO TCombo WITH WM_PAINT, CB_SHOWDRO, pnObject
DO TCombo WITH CBN_INLIST, .F., pnObject
DO TCombo WITH WM_PAINT, CB_HIDELST, pnObject
RESTORE SCREEN FROM Tcombo
RELEASE SCREEN Tcombo
@ 11, 6 GET CD_LIST_1 PICTURE 'XXXXXXXXXXXXX'
CLEAR GETS
CASE pn_msg = CB_SELECTS
*-----------------------------------------------------
*-- Do not repaint the get area during scroll re-entry
*-----------------------------------------------------
IF nCd_list > 0
IF BAR() <> nCd_list
RETURN
ELSE
nCd_list = 0
ENDIF
ENDIF
IF TYPE( "p__data" ) = "L"
cPrompt = PROMPT()
ELSE
cPrompt = p__data
ENDIF
cFileRoot = _FileRoot( cPrompt )
IF .NOT. "<" $ cFileRoot
STORE cFileRoot + "." + _FileType( cPrompt ) TO cDisplay
STORE LEFT( cPrompt + SPACE( 80 ), 80 ) TO CD_LIST_1
STORE LEFT( cDisplay + SPACE( 80 ), 80 ) TO cDisplay
@ 11 , 6 GET cDisplay PICTURE 'XXXXXXXXXXXXX'
CLEAR GETS
ENDIF
CASE pn_msg = CBN_INLIST
SET COLOR OF MESS TO n/gb
SET COLOR OF TITLE TO n/gb
nMsEvent = 0
nMess = 0
nAccel = 0
pl_IsPop = .T.
ON MOUSE DO MsHand WITH MROW(), MCOL(), .T.
DO SetOnKey
ON KEY LABEL Tab DO TabOut WITH KB_TAB
ON KEY LABEL BackTab DO TabOut WITH KB_SHIFTTAB
ON POPUP CD_LIST_1 DO TCombo WITH CB_SELECTS, .F., pnObject
ON SELECTION POPUP CD_LIST_1 DO TComboSel
*-------------------------------------------------
*-- Keyboard in down arrows to match prompt string
*-------------------------------------------------
IF nCd_list > 0
n = 1
nHowMany = nCd_list - 1
IF ISBLANK( CATALOG() )
nHowMany = nHowMany - 3
ELSE
nHowMany = nHowMany - 2
ENDIF
DO WHILE n <= nHowMany
KEYBOARD [{DnArrow}]
n = n + 1
ENDDO
ENDIF
ACTIVATE POPUP CD_LIST_1
pl_IsPop = .F.
ON KEY LABEL Tab
ON KEY LABEL BackTab
DO ClrOnKey
ON MOUSE
IF BAR() > 0
nMess = KB_ENTER
nCd_list = BAR()
ELSE
IF nMess = 0
IF nMsEvent = KB_MOUSE
nMess = KB_MOUSE
RESTORE SCREEN FROM CD_LIST_1
RELEASE SCREEN CD_LIST_1
ELSE
nMess = LASTKEY()
ENDIF
ELSE
RESTORE SCREEN FROM CD_LIST_1
RELEASE SCREEN CD_LIST_1
ENDIF
ENDIF
ENDCASE
ENDCASE
RETURN
*-- EOP: TCombo WITH pn_msg, p__data, pnObject
PROCEDURE TComboSel
*----------------------------------------------------------------------------
* NAME
* TComboSel -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
DO TCombo WITH CB_SELECTS, .F., pnObject
DEACTIVATE POPUP
RETURN
*-- EOP: TComboSel
PROCEDURE GetDD
*----------------------------------------------------------------------------
* NAME
* GetDD - Get Edit field for Combo Box Drop Down
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
nMess = 0
nAccel = 0
*-------------------------------------------------
*-- Look to see if the object in focus has a title
*-------------------------------------------------
DO HasTitle WITH nCurrent, BN_HILITE
nMsEvent = 0
ON MOUSE DO MsHand WITH MROW(), MCOL()
DO SetOnKey
DO CASE
CASE nCurrent = 9 && CD_FILE_1
@ 3, 6 GET CD_FILE_1 PICTURE '@S13'
@ 3, 19 SAY CHR(222) COLOR g/w
@ 3, 20 SAY CHR(25) COLOR n/g
@ 3, 21 SAY CHR(221) COLOR g/w
CASE nCurrent = 37 && CD_LIST_1
@ 11, 6 GET CD_LIST_1 PICTURE '@S13'
@ 11, 19 SAY CHR(222) COLOR g/w
@ 11, 20 SAY CHR(25) COLOR n/g
@ 11, 21 SAY CHR(221) COLOR g/w
ENDCASE
SET CURSOR ON
READ
SET CURSOR OFF
DO ClrOnKey
ON MOUSE
IF nMsEvent = KB_MOUSE
nMess = KB_MOUSE
ELSE
nMess = LASTKEY()
ENDIF
RETURN
*-- EOP: GetDD
PROCEDURE SetOnKey
*----------------------------------------------------------------------------
* NAME
* SetOnKey - For each pick key, set on key label
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
ON KEY LABEL Alt-G DO AKeyHand WITH '9'
ON KEY LABEL Alt-d DO AKeyHand WITH '11'
ON KEY LABEL Alt-C DO AKeyHand WITH '20'
ON KEY LABEL Alt-S DO AKeyHand WITH '24'
ON KEY LABEL Alt-o DO AKeyHand WITH '21'
ON KEY LABEL Alt-p DO AKeyHand WITH '25'
ON KEY LABEL Alt-N DO AKeyHand WITH '28'
ON KEY LABEL Alt-T DO AKeyHand WITH '31'
ON KEY LABEL Alt-F DO AKeyHand WITH '37'
ON KEY LABEL Alt-E DO AKeyHand WITH '39'
ON KEY LABEL Alt-L DO AKeyHand WITH '51'
RETURN
*-- EOP: SetOnKey
PROCEDURE ClrOnKey
*----------------------------------------------------------------------------
* NAME
* ClrOnKey - For each pick key, clear on label
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
ON KEY LABEL Alt-G
ON KEY LABEL Alt-d
ON KEY LABEL Alt-C
ON KEY LABEL Alt-S
ON KEY LABEL Alt-o
ON KEY LABEL Alt-p
ON KEY LABEL Alt-N
ON KEY LABEL Alt-T
ON KEY LABEL Alt-F
ON KEY LABEL Alt-E
ON KEY LABEL Alt-L
RETURN
*-- EOP: ClrOnKey
PROCEDURE AKeyHand
PARAMETERS cId
*----------------------------------------------------------------------------
* NAME
* AKeyHand - On key handler for Accel key from popup or get
*
* DESCRIPTION
*
* PARAMETERS
* nId =
*
*----------------------------------------------------------------------------
IF nAccel <> nCurrent
nAccel = VAL( cId )
IF TYPE( "pl_IsPop" ) = "L" .AND. pl_IsPop
DO CASE
CASE nCurrent = 9
STORE BAR() TO nCD_FILE
SAVE SCREEN TO CD_FILE_1
KEYBOARD "{LeftArrow}"
nMess = KB_ENTER
CASE nCurrent = 37
STORE BAR() TO nCD_LIST
SAVE SCREEN TO CD_LIST_1
KEYBOARD "{LeftArrow}"
nMess = KB_ENTER
OTHERWISE
KEYBOARD "{Ctrl-W}"
nMess = KB_CTRLW
ENDCASE
ELSE
KEYBOARD "{Ctrl-W}"
nMess = KB_CTRLW
ENDIF
ELSE
nAccel = 0
ENDIF
RETURN
*-- EOP: AKeyHand WITH nId
PROCEDURE CkWaitAc
*----------------------------------------------------------------------------
* NAME
* CkWaitAc - Look for Accel key from Wait command
*
* DESCRIPTION
* This routine has high International risk for translations.
*----------------------------------------------------------------------------
IF nMess < 0
nAccPress = nMess + 500
ELSE
IF nMess >= 97 .AND. nMess <= 122
nMess = nMess - 32
ENDIF
nAccPress = nMess
ENDIF
DO CASE
CASE nAccPress = 71 && G - CD_FILE_0
nAccel = 9
CASE nAccPress = 68 && d - BT_EDITCF
nAccel = 11
CASE nAccPress = 67 && C - RB_MODE_1
nAccel = 20
CASE nAccPress = 83 && S - RB_MODE_2
nAccel = 24
CASE nAccPress = 79 && o - CK_OPTI_1
nAccel = 21
CASE nAccPress = 80 && p - CK_OPTI_2
nAccel = 25
CASE nAccPress = 78 && N - CK_OPTI_3
nAccel = 28
CASE nAccPress = 84 && T - CK_OPTI_4
nAccel = 31
CASE nAccPress = 70 && F - CD_LIST_0
nAccel = 37
CASE nAccPress = 69 && E - BT_EDIT
nAccel = 39
CASE nAccPress = 76 && L - BT_LINK
nAccel = 51
OTHERWISE
nAccel = 0
ENDCASE
RETURN
*-- EOP: CkWaitAc
FUNCTION GetMsTo
PARAMETER plChkOnly
*----------------------------------------------------------------------------
* NAME
* GetMsTo() -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
*-- Check for a click on the close button
IF nMRow = nRowCls .AND. nMCol >= nLColCls .AND. nMCol <= nRColCls
nMess = DLN_CANCEL
nRtn = 0
ELSE
IF nMRow = nRowCls .AND. nMCol >= nCol .AND. nMCol <= nRWinCol
*---------------------------------------------------------
*-- All this to remove the shadow before moving the window
*---------------------------------------------------------
SAVE WINDOW BDCOPT TO _BDCOPT
RELEASE WINDOW BDCOPT
RESTORE SCREEN FROM BDCOPT
RESTORE WINDOW BDCOPT FROM _BDCOPT
ERASE _BDCOPT.win
ACTIVATE WINDOW BDCOPT
@ 0, 0 TO nHigh - 1, nWidth - 1 COLOR g+/w
@ 0, 2 SAY "[ ]" COLOR g+/w
@ 0, 3 SAY CHR( 254 ) COLOR g+/w
@ 0, 21 SAY "[ Compiler Options ]" COLOR g+/w
*-------------------------------
*-- Start the move window action
*-------------------------------
nDelX = nMRow
nDelY = nMCol
SET CONSOLE OFF
WAIT
SET CONSOLE ON
nMRow = MROW()
nMCol = MCOL()
nDelX = nMRow - nDelX
nDelY = nMCol - nDelY
lMoveOk = .T.
ON ERROR lMoveOk = .F.
MOVE WINDOW BDCOPT BY nDelX, nDelY
ON ERROR
IF lMoveOk
nRowCls = nRowCls + nDelX
nCol = nCol + nDelY
nLColCls = ncol + 2 && Left column for close button
nRColCls = ncol + 4 && End column for close button
nRWinCol = ncol + nWidth - 1 && Rigth column for window
nXOffset = nRowCls - nOrigRow
nYOffset = nCol - nOrigCol
ENDIF
*---------------------------------------------------------
*-- Display the new shadow for after moving the dialog box
*---------------------------------------------------------
SAVE WINDOW BDCOPT TO _BDCOPT
RELEASE WINDOW BDCOPT
RESTORE SCREEN FROM BDCOPT
ACTIVATE SCREEN
IF nCol + 63 < 80 .AND. nRowCls + 19 <= nScreen
@ nRowCls + 1, nCol + 1 FILL TO nRowCls + 19, nCol + 63 COLOR n+/n
ENDIF
RESTORE WINDOW BDCOPT FROM _BDCOPT
ERASE _BDCOPT.win
ACTIVATE WINDOW BDCOPT
@ 0, 0 TO nHigh - 1, nWidth - 1 DOUBLE COLOR w+/w
@ 0, 2 SAY "[ ]" COLOR w+/w
@ 0, 3 SAY CHR( 254 ) COLOR g+/w
@ 0, 21 SAY "[ Compiler Options ]" COLOR w+/w
nRtn = -1
ELSE
*-----------------------------------
*-- Check for click on a live object
*-----------------------------------
nRtn = 0
i = 1
DO WHILE i <= nClkObj
IF nMRow = aClkObj[ i, 1 ] + nXOffSet .AND. ;
nMCol >= aClkObj[ i, 2 ] + nYOffset .AND. ;
nMCol <= aClkObj[ i, 3 ] + nYOffset
nRtn = aClkObj[ i, 4 ]
EXIT
ENDIF
i = i + 1
ENDDO
IF nRtn = 0
*----------------------------------------------------------
*-- Not found, check for a click in a Combo box or list box
*----------------------------------------------------------
IF nClkBox > 0
i = 1
DO WHILE i <= nClkBox
IF nMRow >= aClkBox[ i, 1 ] + nXOffset .AND. ;
nMRow <= aClkBox[ i, 1 ] + nXOffset + aClkBox[ i, 2 ] .AND. ;
nMCol >= aClkBox[ i, 3 ] + nYOffset .AND. ;
nMCol <= aClkBox[ i, 3 ] + nYOffset + aClkBox[ i, 4 ]
nRtn = aClkBox[ i, 5 ] - 1
aClkBox[ i, 6 ] = .T.
EXIT
ENDIF
i = i + 1
ENDDO
ENDIF
ENDIF
ENDIF
ENDIF
RETURN( nRtn )
*-- EOF: GetMsTo( )
PROCEDURE MsHand
PARAMETERS pnMRow, pnMCol, pl_IsPop
*----------------------------------------------------------------------------
* NAME
* MsHand -
*
* DESCRIPTION
*
* PARAMETERS
* pnMRow =
* pnMCol =
* pl_IsPop =
*
*----------------------------------------------------------------------------
nMRow = pnMRow
nMCol = pnMCol
nMsEvent = KB_MOUSE
IF pl_IsPop
DO CASE
CASE nCurrent = 9
STORE BAR() TO nCD_FILE
SAVE SCREEN TO CD_FILE_1
KEYBOARD "{LeftArrow}"
CASE nCurrent = 37
STORE BAR() TO nCD_LIST
SAVE SCREEN TO CD_LIST_1
KEYBOARD "{LeftArrow}"
ENDCASE
ELSE
KEYBOARD "{Ctrl-W}"
ENDIF
RETURN
*-- EOP: MsHand WITH pnMRow, pnMCol, pl_IsPop
PROCEDURE Dispatch
*----------------------------------------------------------------------------
* NAME
* Dispatch -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
DO CASE
CASE nCurrent = 9 && CD_FILE_1
DO DispCD
CASE nCurrent = 11 && BT_EDITCF
DO DispBt
CASE nCurrent = 20 && RB_MODE_1
DO DispRb
CASE nCurrent = 24 && RB_MODE_2
DO DispRb
CASE nCurrent = 21 && CK_OPTI_1
DO DispCk
CASE nCurrent = 25 && CK_OPTI_2
DO DispCk
CASE nCurrent = 28 && CK_OPTI_3
DO DispCk
CASE nCurrent = 31 && CK_OPTI_4
DO DispCk
CASE nCurrent = 37 && CD_LIST_1
DO DispCD
CASE nCurrent = 39 && BT_EDIT
DO DispBt
CASE nCurrent = 48 && BT_OK
DO DispBt
CASE nCurrent = 49 && BT_CANCEL
DO DispBt
CASE nCurrent = 50 && BT_HELP
DO DispBt
CASE nCurrent = 51 && BT_LINK
DO DispBt
ENDCASE
RETURN
*-- EOP: Dispatch
PROCEDURE DispRb
*----------------------------------------------------------------------------
* NAME
* DispRb -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
PRIVATE nPossNext
DO CASE
CASE nMess = KB_TAB
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH .T.
CASE nMess = KB_SHIFTTAB
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH .F.
CASE nMess = KB_UPARROW .OR. nMess = KB_LEFTARROW
DO TButton WITH BN_CLICKED, .F., nCurrent
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH .F., .T.
DO TButton WITH BN_CLICKED, .F., nCurrent
CASE nMess = KB_DOWNARROW .OR. nMess = KB_RTARROW
DO TButton WITH BN_CLICKED, .F., nCurrent
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH .T., .T.
DO TButton WITH BN_CLICKED, .F., nCurrent
CASE nMess = KB_MOUSE
nPossNext = GetMsTo()
IF nPossNext > 0
IF nPossNext <> nCurrent
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH nPossNext, .F.
ENDIF
ENDIF
CASE nMess = KB_ENTER
IF nDlgDef > 0
DO TButton WITH BN_CLICKED, .F., nDlgDef
ENDIF
OTHERWISE
DO CkWaitAc
IF nAccel > 0
IF nAccel <> nCurrent
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH nAccel, .F.
ENDIF
ENDIF
ENDCASE
RETURN
*-- EOP: DispRb
PROCEDURE DispCk
*----------------------------------------------------------------------------
* NAME
* DispCk -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
PRIVATE nPossNext
DO CASE
CASE nMess = KB_TAB
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH .T.
CASE nMess = KB_SHIFTTAB
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH .F.
CASE nMess = KB_UPARROW .OR. nMess = KB_LEFTARROW
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH .F., .T.
CASE nMess = KB_DOWNARROW .OR. nMess = KB_RTARROW
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH .T., .T.
CASE nMess = KB_SPACE
DO TButton WITH BN_CLICKED, .F., nCurrent
CASE nMess = KB_MOUSE
nPossNext = GetMsTo()
IF nPossNext > 0
IF nPossNext = nCurrent
DO TButton WITH BN_CLICKED, .F., nCurrent
ELSE
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH nPossNext, .F.
ENDIF
ENDIF
CASE nMess = KB_ENTER
IF nDlgDef > 0
DO TButton WITH BN_CLICKED, .F., nDlgDef
ENDIF
OTHERWISE
DO CkWaitAc
IF nAccel > 0
IF nAccel = nCurrent
DO TButton WITH BN_CLICKED, .F., nCurrent
ELSE
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH nAccel, .F.
ENDIF
ENDIF
ENDCASE
RETURN
*-- EOP: DispCk
PROCEDURE DispBt
*----------------------------------------------------------------------------
* NAME
* DispBt -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
PRIVATE nPossNext
DO CASE
CASE nMess = KB_TAB
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH .T.
CASE nMess = KB_SHIFTTAB
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH .F.
CASE nMess = KB_ENTER
DO TButton WITH BN_CLICKED, .F., nCurrent
CASE nMess = KB_MOUSE
nPossNext = GetMsTo()
IF nPossNext > 0
IF nPossNext = nCurrent
DO TButton WITH BN_CLICKED, .F., nCurrent
ELSE
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH nPossNext, .F.
ENDIF
ENDIF
OTHERWISE
DO CkWaitAc
IF nAccel > 0
IF nAccel = nCurrent
DO TButton WITH BN_CLICKED, .F., nCurrent
ELSE
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
DO GetNext WITH nAccel, .F.
ENDIF
ENDIF
ENDCASE
RETURN
*-- EOP: DispBt
PROCEDURE DispCD
*----------------------------------------------------------------------------
* NAME
* DispCD -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
DO CASE
CASE nMess = KB_TAB
DO GetNext WITH .T.
CASE nMess = KB_SHIFTTAB
DO GetNext WITH .F.
CASE nMess = KB_MOUSE
nPossNext = GetMsTo()
IF nPossNext = nCurrent
nMess = KB_UPARROW
DO DispCD && Make a recursive call
ELSE
IF nPossNext > 0
DO GetNext WITH nPossNext
ENDIF
ENDIF
CASE nMess = KB_CTRLW .AND. nAccel > 0
DO GetNext WITH nAccel
CASE nMess = KB_ENTER
IF nDlgDef > 0
DO GetNext WITH nDlgDef
IF nCurrent = nDlgDef
DO TButton WITH BN_CLICKED, .F., nDlgDef
ENDIF
ENDIF
CASE nMess = KB_DOWNARROW .OR. ;
nMess = KB_UPARROW
DO TCombo WITH CBN_DROPDOW, .F., nCurrent
*-----------------------------------------------
*-- GENCODE - Do VALID code here from Memo field
*-----------------------------------------------
DO CASE
CASE nCurrent = 9 && CD_FILE_1
IF BDCFill( [CD_FILE_1] )
ENDIF
ENDCASE
IF nMsEvent = KB_MOUSE
nPossNext = GetMsTo()
IF nPossNext > 0
IF nPossNext <> nCurrent
*-- User clicked to another field
DO GetNext WITH nPossNext
ENDIF
ENDIF
ELSE
DO CASE
CASE nMess = KB_TAB
DO GetNext WITH .T.
CASE nMess = KB_SHIFTTAB
DO GetNext WITH .F.
CASE nAccel > 0
DO GetNext WITH nAccel
ENDCASE
ENDIF
OTHERWISE
DO CkWaitAc
IF nAccel > 0
IF nAccel <> nCurrent
DO GetNext WITH nAccel
ENDIF
ENDIF
ENDCASE
RETURN
*-- EOP: DispCD
PROCEDURE GetNext
PARAMETERS p__dir, pl_SameGrp
*----------------------------------------------------------------------------
* NAME
* GetNext -
*
* DESCRIPTION
*
* PARAMETERS
* p__dir = .T. to go forward, .F. to go back, number to go to
* record number.
* pl_SameGrp = .F. to go to first item in next/prev group, .T. will
* go to the next/prev item within the same group. Only
* applies to p__dir being next/previous.
*
*----------------------------------------------------------------------------
PRIVATE cPrevClass, nWay, npCurrent, nPointer, nNextObj, nNextPtr
PRIVATE nRecNo, npRecNo, lExit, cField, cVar, cCurrClass
*--------------------------------------------------------------
*-- Check for OK conditions, unless its a direct move to cancel
*--------------------------------------------------------------
IF ( TYPE( 'p__dir' ) = "N" .AND. p__dir <> nCancelBt ) .OR. ;
TYPE( 'p__dir' ) = "L"
DO CASE
CASE nCurrent = 9 && CD_FILE_1
IF .NOT. BDCFill( [CD_FILE_1] )
RETURN
ENDIF
ENDCASE
ENDIF
*------------------------------------------
*-- Check for move out of the current group
*------------------------------------------
IF .NOT. pl_SameGrp
IF TYPE( "p__dir" ) = "L"
DO HasTitle WITH nCurrent, BN_UNHILITE
ENDIF
ENDIF
cPrevClass = LEFT( aClkObj[ aObjPoint[ nCurrent ], 11 ], 3 )
*--------------------------------------------------
*-- Set the current CK or RB pointer before leaving
*--------------------------------------------------
DO CASE
CASE nCurrent = 20 && RB_MODE_1
STORE nCurrent TO nRB_MODE
CASE nCurrent = 24 && RB_MODE_2
STORE nCurrent TO nRB_MODE
CASE nCurrent = 21 && CK_OPTI_1
STORE nCurrent TO nCK_OPTI
CASE nCurrent = 25 && CK_OPTI_2
STORE nCurrent TO nCK_OPTI
CASE nCurrent = 28 && CK_OPTI_3
STORE nCurrent TO nCK_OPTI
CASE nCurrent = 31 && CK_OPTI_4
STORE nCurrent TO nCK_OPTI
ENDCASE
*----------------------------------------
*-- Handle the forward and backward moves
*----------------------------------------
IF TYPE( "p__dir" ) = "L"
DO CASE
*-------------------------------------------
*-- Go forward or backward in the same group
*-------------------------------------------
CASE pl_SameGrp
nWay = IIF( p__dir, 10, 9 ) && 10 Forward, 9 Back
npCurrent = aObjPoint[ nCurrent ]
nPointer = npCurrent
*-----------------------------------------------
*-- Is this a one item radio button or check box
*-----------------------------------------------
IF aClkObj[ npCurrent, 4 ] <> aClkObj[ npCurrent, nWay ]
DO WHILE .T.
*------------------------------------------------------
*-- Check to see if the next object's WHEN clause is Ok
*------------------------------------------------------
nNextObj = aClkObj[ nPointer, nWay ]
IF WhenOk( nNextObj )
nPointer = aObjPoint[ nNextObj ]
EXIT
ELSE
*-----------------------------------------------
*-- See if we looped back to the item we were on
*-----------------------------------------------
nNextPtr = aObjPoint[ nNextObj ]
IF nNextPtr = npCurrent
EXIT
ELSE
nPointer = nNextPtr
ENDIF
ENDIF
ENDDO
ENDIF
IF nPointer <> npCurrent
nCurrent = aClkObj[ nPointer, 4 ]
nCurrGrp = aClkObj[ nPointer, 5 ]
ENDIF
OTHERWISE
nWay = IIF( p__dir, 6, 7 ) && 6 Forward, 7 Back
nRecNo = nCurrent
npRecNo = aObjPoint[ nRecNo ]
lExit = .F.
DO WHILE aClkObj[ npRecNo, 5 ] = nCurrGrp
nRecNo = aClkObj[ npRecNo, nWay ]
npRecNo = aObjPoint[ nRecNo ]
IF aClkObj[ npRecNo, 5 ] = nCurrGrp
LOOP
ELSE
*--------------------------------------------------
*-- Finally, we have moved out of the current group
*--------------------------------------------------
nCurrGrp = aClkObj[ npRecNo, 5 ]
IF .NOT. WhenOk( nRecNo )
LOOP
ELSE
nCurrent = nRecNo
lExit = .T.
ENDIF
ENDIF
*---------------------------------------------------------
*-- Was this a move into a radio button or check box group
*---------------------------------------------------------
cField = aClkObj[ npRecNo, 11 ]
cVar = "N" + LEFT( cField, RAT( "_", cField ) - 1 )
DO CASE
CASE cVar = "NRB_MODE"
nRecNo = NRB_MODE
npRecNo = aObjPoint[ nRecNo ]
nCurrent = nRecNo
nCurrGrp = aClkObj[ npRecNo, 5 ]
CASE cVar = "NCK_OPTI"
nRecNo = NCK_OPTI
npRecNo = aObjPoint[ nRecNo ]
nCurrent = nRecNo
nCurrGrp = aClkObj[ npRecNo, 5 ]
ENDCASE
IF lExit
EXIT
ENDIF
ENDDO
DO HasTitle WITH nCurrent, BN_HILITE
ENDCASE
ELSE
*-------------------------------------------------------
*-- Handle direct moves to objects via Alt key and Mouse
*-------------------------------------------------------
IF .NOT. WhenOk( p__dir )
nMess = 0
RETURN
ENDIF
*--------------------------------------------------------------
*-- Check to see if we are leaving or going into a radio button
*-- group. If so, we may have to toggle off the current dot.
*--------------------------------------------------------------
DO CASE
*-----------------------------------------------------------
*-- If the current object is a radio button and the group to
*-- move into is the same, then...
*-----------------------------------------------------------
CASE LEFT( aClkObj[ aObjPoint[ nCurrent ], 11 ], 3 ) = "RB_" .AND. ;
aClkObj[ aObjPoint[ p__dir ], 5 ] = nCurrGrp
DO CASE
CASE nCurrent = 20
STORE .F. TO RB_MODE_1
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
CASE nCurrent = 24
STORE .F. TO RB_MODE_2
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
ENDCASE
*---------------------------------------------
*-- If we are moving into a radio button group
*---------------------------------------------
CASE LEFT( aClkObj[ aObjPoint[ p__dir ], 11 ], 3 ) = "RB_"
DO CASE
CASE p__dir = 20
IF p__dir <> nRB_MODE
cField = aClkObj[ aObjPoint[ nRB_MODE ], 11 ]
STORE .F. TO &cField
DO TButton WITH WM_PAINT, BN_UNHILITE, nRB_MODE
ENDIF
CASE p__dir = 24
IF p__dir <> nRB_MODE
cField = aClkObj[ aObjPoint[ nRB_MODE ], 11 ]
STORE .F. TO &cField
DO TButton WITH WM_PAINT, BN_UNHILITE, nRB_MODE
ENDIF
ENDCASE
ENDCASE
IF nCurrGrp <> aClkObj[ aObjPoint[ p__dir ], 5 ]
DO HasTitle WITH nCurrent, BN_UNHILITE
DO HasTitle WITH p__dir, BN_HILITE
nCurrent = p__dir
nCurrGrp = aClkObj[ aObjPoint[ nCurrent ], 5 ]
DO CASE
CASE nCurrent = 11
DO TButton WITH BN_CLICKED, .F., nCurrent
CASE nCurrent = 39
DO TButton WITH BN_CLICKED, .F., nCurrent
CASE nCurrent = 48
DO TButton WITH BN_CLICKED, .F., nCurrent
CASE nCurrent = 49
DO TButton WITH BN_CLICKED, .F., nCurrent
CASE nCurrent = 50
DO TButton WITH BN_CLICKED, .F., nCurrent
CASE nCurrent = 51
DO TButton WITH BN_CLICKED, .F., nCurrent
ENDCASE
ELSE
DO HasTitle WITH p__dir, BN_HILITE
ENDIF
nCurrent = p__dir
nCurrGrp = aClkObj[ aObjPoint[ nCurrent ], 5 ]
ENDIF
*---------------------------------------------------------------
*-- Repaint the Default button if we were on a button before and
*-- the target is not a button.
*---------------------------------------------------------------
cCurrClass = LEFT( aClkObj[ aObjPoint[ nCurrent ], 11 ], 3 )
IF cPrevClass = "BT_" .AND. cCurrClass <> "BT_"
DO TButton WITH WM_PAINT, BN_DEFAULT, nDlgDef
STORE .T. TO BT_OK
ENDIF
*---------------------------------------------------------
*-- Save the current CK or RB pointer for the target group
*---------------------------------------------------------
DO CASE
CASE nCurrent = 11 && BT_EDITCF
STORE nCurrent TO nBT
IF TYPE( "p__dir" ) = "N"
STORE .T. TO BT_EDITCF
ENDIF
CASE nCurrent = 20 && RB_MODE_1
STORE nCurrent TO nRB_MODE
IF TYPE( "p__dir" ) = "N"
STORE .F. TO RB_MODE_1
DO TButton WITH BN_CLICKED, .F., nCurrent
ENDIF
CASE nCurrent = 24 && RB_MODE_2
STORE nCurrent TO nRB_MODE
IF TYPE( "p__dir" ) = "N"
STORE .F. TO RB_MODE_2
DO TButton WITH BN_CLICKED, .F., nCurrent
ENDIF
CASE nCurrent = 21 && CK_OPTI_1
STORE nCurrent TO nCK_OPTI
IF TYPE( "p__dir" ) = "N"
DO TButton WITH BN_CLICKED, .F., nCurrent
ENDIF
CASE nCurrent = 25 && CK_OPTI_2
STORE nCurrent TO nCK_OPTI
IF TYPE( "p__dir" ) = "N"
DO TButton WITH BN_CLICKED, .F., nCurrent
ENDIF
CASE nCurrent = 28 && CK_OPTI_3
STORE nCurrent TO nCK_OPTI
IF TYPE( "p__dir" ) = "N"
DO TButton WITH BN_CLICKED, .F., nCurrent
ENDIF
CASE nCurrent = 31 && CK_OPTI_4
STORE nCurrent TO nCK_OPTI
IF TYPE( "p__dir" ) = "N"
DO TButton WITH BN_CLICKED, .F., nCurrent
ENDIF
CASE nCurrent = 39 && BT_EDIT
STORE nCurrent TO nBT
IF TYPE( "p__dir" ) = "N"
STORE .T. TO BT_EDIT
ENDIF
CASE nCurrent = 48 && BT_OK
STORE nCurrent TO nBT
IF TYPE( "p__dir" ) = "N"
STORE .T. TO BT_OK
ENDIF
CASE nCurrent = 49 && BT_CANCEL
STORE nCurrent TO nBT
IF TYPE( "p__dir" ) = "N"
STORE .T. TO BT_CANCEL
ENDIF
CASE nCurrent = 50 && BT_HELP
STORE nCurrent TO nBT
IF TYPE( "p__dir" ) = "N"
STORE .T. TO BT_HELP
ENDIF
CASE nCurrent = 51 && BT_LINK
STORE nCurrent TO nBT
IF TYPE( "p__dir" ) = "N"
STORE .T. TO BT_LINK
ENDIF
ENDCASE
RETURN
*-- EOP: GetNext WITH p__dir, pl_SameGrp
FUNCTION WhenOk
PARAMETERS pnTarget
*----------------------------------------------------------------------------
* NAME
* WhenOk - Validate the WHEN condition for a target object
*
* DESCRIPTION
*
* PARAMETERS
* pnTarget = Object ID to verify against
*
*----------------------------------------------------------------------------
PRIVATE lWhenOk
lWhenOk = .T.
DO CASE
CASE pnTarget = 11 && BT_EDITCF
IF .NOT. ( .NOT. ISBLANK( CD_FILE_1 ) .AND. .NOT. ( "*" $ CD_FILE_1 .OR. "?" $ CD_FILE_1 ) )
lWhenOk = .F.
ENDIF
CASE pnTarget = 39 && BT_EDIT
IF .NOT. ( LEFT(CD_LIST_1,1)=[@] )
lWhenOk = .F.
ENDIF
ENDCASE
RETURN lWhenOk
*-- EOF: WhenOk( pnTarget )
FUNCTION GetId
PARAMETERS pcVar
*----------------------------------------------------------------------------
* NAME
* GetId() - Search for memvar name and return current_id
*----------------------------------------------------------------------------
PRIVATE nId
nId = 0
DO CASE
CASE pcVar = "CD_FILE_0"
nId = 6
CASE pcVar = "CD_FILE_1"
nId = 9
CASE pcVar = "BT_EDITCF"
nId = 11
CASE pcVar = "RB_MODE_0"
nId = 16
CASE pcVar = "CK_OPTI_0"
nId = 17
CASE pcVar = "RB_MODE_1"
nId = 20
CASE pcVar = "CK_OPTI_1"
nId = 21
CASE pcVar = "RB_MODE_2"
nId = 24
CASE pcVar = "CK_OPTI_2"
nId = 25
CASE pcVar = "CK_OPTI_3"
nId = 28
CASE pcVar = "CK_OPTI_4"
nId = 31
CASE pcVar = "CD_LIST_0"
nId = 34
CASE pcVar = "CD_LIST_1"
nId = 37
CASE pcVar = "BT_EDIT"
nId = 39
CASE pcVar = "BT_OK"
nId = 48
CASE pcVar = "BT_CANCEL"
nId = 49
CASE pcVar = "BT_HELP"
nId = 50
CASE pcVar = "BT_LINK"
nId = 51
ENDCASE
RETURN( nId )
*-- EOF: GetId( pcVar)
PROCEDURE PostVals
*----------------------------------------------------------------------------
* NAME
* PostVals -
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
IF TYPE( "BDCOPT[1]" ) <> "U"
BDCOPT[ 1 ] = CD_FILE_1
BDCOPT[ 2 ] = BT_EDITCF
BDCOPT[ 3 ] = RB_MODE_1
BDCOPT[ 4 ] = RB_MODE_2
BDCOPT[ 5 ] = CK_OPTI_1
BDCOPT[ 6 ] = CK_OPTI_2
BDCOPT[ 7 ] = CK_OPTI_3
BDCOPT[ 8 ] = CK_OPTI_4
BDCOPT[ 9 ] = CD_LIST_1
BDCOPT[ 10 ] = BT_EDIT
BDCOPT[ 11 ] = BT_OK
BDCOPT[ 12 ] = BT_CANCEL
BDCOPT[ 13 ] = BT_HELP
BDCOPT[ 14 ] = BT_LINK
ENDIF
RETURN
*-- EOP: PostVals
PROCEDURE ReleObjs
*----------------------------------------------------------------------------
* NAME
* ReleObjs - Scan the design DBF file and release the object variables
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
RELEASE POPUP CD_FILE_1
RELEASE POPUP CD_LIST_1
RETURN
*-- EOP: ReleObjs
PROCEDURE IBDCOPT
*----------------------------------------------------------------------------
* NAME
* IBDCOPT - Builds the Initialization array for this dialog box
*
* DESCRIPTION
* IBDCOPT with create a routine that you can call or cut from this
* file to run a dialog box and capture the data on exit.
*
* To run the dialog box,
* SET PROCEDURE TO BDCOPT
* DO IBDCOPT
*
* Running IBDCOPT with use the defaults from the SCR file. The
* array will remain in memory after execution.
*
* REMEMBER, REGENERATING THE DIALOG BOX WILL OVERWRITE THIS PROCEDURE!
*
*----------------------------------------------------------------------------
PUBLIC ARRAY BDCOPT[ 14 ]
*-- CD_FILE_1 - XXXXXXXXXXXXX [v]
BDCOPT[ 1 ] = [*.CFG] + SPACE( 75 )
*-- BT_EDITCF - E~dit config file
BDCOPT[ 2 ] = .F.
*-- RB_MODE_1 - ( ) ~Compact
BDCOPT[ 3 ] = .T.
*-- RB_MODE_2 - ( ) ~Standalone
BDCOPT[ 4 ] = .F.
*-- CK_OPTI_1 - [ ] Compile ~only
BDCOPT[ 5 ] = .F.
*-- CK_OPTI_2 - [ ] Dis~play offending code
BDCOPT[ 6 ] = .T.
*-- CK_OPTI_3 - [ ] ~No warning messages
BDCOPT[ 7 ] = .T.
*-- CK_OPTI_4 - [ ] Set Lang~Tables on
BDCOPT[ 8 ] = .F.
*-- CD_LIST_1 - XXXXXXXXXXXXX [v]
BDCOPT[ 9 ] = [*.PRG] + SPACE( 75 )
*-- BT_EDIT - ~Edit file list
BDCOPT[ 10 ] = .F.
*-- BT_OK - Ok
BDCOPT[ 11 ] = .T.
*-- BT_CANCEL - Cancel
BDCOPT[ 12 ] = .F.
*-- BT_HELP - Help
BDCOPT[ 13 ] = .F.
*-- BT_LINK - ~Link options ...
BDCOPT[ 14 ] = .F.
*--------------------------------------------------------------
*-- FXL_Cancel is set to .T. is the user Cancels the dialog box
*--------------------------------------------------------------
FXL_Cancel = .F.
*--------------------------------------------------------------
*-- FXL_NoChng lets the dialog box know that the values in the
*-- array are not different from the SCR file defaults. This
*-- will allow the dialog box to use the .WIN file for a faster
*-- startup.
*--------------------------------------------------------------
FXL_NoChng = .T.
DO BDCOPT
IF .NOT. FXL_Cancel && The user clicked on OK
*-----------------------------------
*-- Put your Ok processing code here
*-----------------------------------
ENDIF
RELEASE BDCOPT
RETURN
*-- EOP: IBDCOPT